For N = 3 one valid array is [3,1,2,1,3,2].
The first line of input contains an integer ‘T’, denoting the number of test cases. The test cases follow. The first and the only line of each test case contains a single integer ‘N’.
The checker will print “Valid” if the returned permutation is valid and follows all the conditions, otherwise, it will print “Invalid”. If an empty array is returned, the checker will print -1. Print the output of each test case in a new line.
You do not need to print anything. It has already been taken care of. Just implement the given function.
1<= T <= 5 1 <= N <= 8 where ’T’ is the number of test cases and ‘N’ is the given integer. Time Limit: 1 sec
Best time to buy and sell stock
Best time to buy and sell stock II
Ninja And The Class Room
Find The Single Element