nums may contain repeated values. Return every different subset (two subsets are the same if they hold the same values with the same counts). Write each subset in increasing order and list the subsets in dictionary order.
For [1, 2, 2]: [], [1], [1, 2], [1, 2, 2], [2], [2, 2].
Example 1
Input:
subsets_with_duplicates([1, 2, 2])
Output:
[[], [1], [1, 2], [1, 2, 2], [2], [2, 2]]
Example 2
Input:
subsets_with_duplicates([0])
Output:
[[], [0]]
0 <= len(nums) <= 14-100 <= nums[i] <= 100No results yet
Run your code to check it against the examples, or submit to run every test.