380. Subsets II
Given an array of integers, arr, which may contain duplicates, find all possible subsets (the power set) without any duplicate subsets. The subsets must be printed in lexicographically sorted order, with each subset on a new line. Please ensure that the output format matches the provided sample output.
The first line of input should contain an integer, N, representing the size of the array. The second line should contain N space-separated integers, describing the elements of the array.
Print all possible subsets, with each subset on a new line and all subsets in sorted order.
3 1 2 2
1 1 2 1 2 2 2 2 2