An array is squareful when the sum of every pair of adjacent elements is a perfect square. Given an array, return the number of its distinct permutations that are squareful. Two permutations are the same if they produce identical sequences of values.
Input: A JSON object {"nums": [<non-negative integers>]}.
Output: Return the count of distinct squareful permutations.
Input: {"nums":[1,17,8]}
Output: 2
Explanation: Two arrangements have all adjacent sums square.Input: {"nums":[2,2,2]}
Output: 1
Explanation: All elements equal, giving a single distinct arrangement.1 <= len(nums) <= 120 <= nums[i] <= 10^9