Subsets with repeated values
Write unique_subsets(items) that returns every distinct subset of a list that may
contain repeated values, as a list of lists. Two subsets are the same if they contain the
same values the same number of times. Order of the output does not matter; each subset
should be in non-decreasing order.
unique_subsets([1, 2, 2]) -> [[], [1], [1, 2], [1, 2, 2], [2], [2, 2]]
unique_subsets([]) -> [[]]
The point is to practise skipping duplicate choices at the same level after sorting.
def unique_subsets(items):
...