Determine the number of possible permutations given an array 'A' consisting of integers where each integer occurs at most 2-times (Pair) and a[n] - a[n-1] != 0.
The first line contains a single integer denoting the number of queries.
The subsequent lines describe each query in the following form: The first line contains an integer denoting the number of elements in array . The second line contains space-separated integers describing the respective values of 'A'.
2 <- Denotes number of queries
4 <- Denotes number of elements in query. This is query 1 of 2.
1 1 2 2 < - Denotes space separated integers
2 < - Denotes number of elements in query. This is query 2 of 2.
1 2 < - Denotes space separated integers