Problem of the day
For the given if ARR = [1,1,3],the answer will be [ ],[1],[1,1],[1,3],[3],[1,1,3].
The first line of the input contains an integer, 'T,’ denoting the number of test cases.
The first line of each test case contains a single integer ‘N’ denoting the number of elements.
The second line of each test case contains ‘ARR’ array.
For each test case, print all the subsets in each line.
You do not need to print anything. It has already been taken care of. Just implement the given function.
Return the output in sorted format as shown in the sample output.
1 <= T <= 10
1 <= N <= 20.
1 <= ARR[i] <=100
Time limit: 1 sec
2
3
1 1 3
4
1 3 3 3
1
1 1
1 3
3
1 1 3
1
1 3
1 3 3
1 3 3 3
3
3 3
3 3 3
For the first test case,
The unique subsets will be [ ],[1],[1,1],[1,3],[3],[1,1,3].
For the second test case:
The unique subsets will be [ ],[1,3],[1,3,3],[1,3,3,3],[3],[3,3],[3,3,3].
2
4
5 5 3 5
3
1 3 5
3
3 5
3 5 5
3 5 5 5
5
5 5
5 5 5
1
1 3
1 3 5
1 5
3
3 5
5