New update is available. Click here to update.

Last Updated: 13 Mar, 2021

Difficulty: Hard

```
ARR[1,3,6] is a Squareful array as 1+3=4 i.e. 2^2 , 3+6=9 i.e. 3^2.
```

```
[1,6,3] and [6,1,3] are different permutations.
```

```
The first line contains an integer ‘N’, representing the array’s size.
The second contains 'N' space-separated integers, denoting the elements of the array.
```

```
For each test case, return an integer denoting the number of Squareful Permutation of array ARR.
```

```
You don’t need to print anything or take input; it already has been taken care of. Just implement the function.
```

```
1 <= N <= 12
0 <= ARR[i] <= 10^4 , where 0 <= i < N
Time limit: 1 sec
```

SIMILAR PROBLEMS

Distance to a Cycle in Undirected Graph

Posted: 7 Nov, 2022

Difficulty: Moderate

Randomly Sorted

Posted: 13 Nov, 2022

Difficulty: Moderate

Merge Two Sorted Arrays Without Extra Space

Posted: 19 Nov, 2022

Difficulty: Moderate

Co-Prime

Posted: 14 Dec, 2022

Difficulty: Hard

8-Queen Problem

Posted: 19 Dec, 2022

Difficulty: Easy

Popular Interview Problems: