Given an array of integers A, the array is squareful if for every pair of adjacent elements,
their sum is a perfect square.
Find and return the number of permutations of A that are squareful. Two permutations A1 and A2 differ
if and only if there is some index i such that A1[ i ] != A2[ i ].
The only argument given is the integer array A.
Return the number of permutations of A that are squareful.
1 <= length of the array <= 12 1 <= A[i] <= 10^9
Input 1: A = [2, 2, 2] Output 1: 1 Input 2: A = [1, 17, 8] Output 2: 2
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.