Number of Squareful Arrays
Count permutations of an integer array where every adjacent pair sums to a perfect square. Handle duplicates by counting each distinct permutation once.
Count permutations of an integer array where every adjacent pair sums to a perfect square. Handle duplicates by counting each distinct permutation once.