Solving Prime Arrangements in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Example 1:

Input: n = 5
Output: 12
Explanation: For example [1,2,5,4,3] is a valid permutation, but [5,2,3,4,1] is not because the prime number 5 is at index 1.

Example 2:

Input: n = 100
Output: 682289015

Constraints:

  • 1 <= n <= 100

  • 1 <= n <= 100

See the full details of the problem Prime Arrangements at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go