Input: arr[] = {1, 2, 2}
Output: {} {1} {1, 2} {1, 2, 2} {2} {2, 2}
Explanation:
The total subsequences of the given array are {}, {1}, {2}, {2}, {1, 2}, {1, 2}, {2, 2}, {1, 2, 2}.
Since {2} and {1, 2} are repeated twice, print all the remaining subsequences of the array.
Input: 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}