Input: N = 3, arr[] = {2, 1, 2}
Output:(), (1), (1 2), (1 2 2), (2), (2 2)
Explanation: All possible subsets = (), (2), (1), (1, 2), (2), (2 2), (2 1), (2, 1, 2)
After Sorting each subset = (), (2), (1), (1, 2), (2), (2, 2), (1, 2), (1, 2, 2)
Unique Subsets in Lexicographical order = (), (1), (1, 2), (1, 2, 2), (2), (2, 2)
Input: N = 4, arr[] = {1, 2, 3, 3}
Output: (), (1), (1 2), (1 2 3)
(1 2 3 3), (1 3), (1 3 3), (2), (2 3)
(2 3 3), (3), (3 3)
Output(), (1), (1 2), (1 2 2), (2), (2 2),