"""
Exercise 2: Subsets II (LeetCode 90)

nums may contain duplicates. Return all subsets without duplicate subsets.
Sort first, then skip nums[i] when i > start and nums[i] == nums[i - 1].
"""

def subsets_with_dup(nums):
    # TODO
    return []


# --- self-check: do not modify below this line ---
got = sorted(map(tuple, subsets_with_dup([1, 2, 2])))
want = sorted(map(tuple, [[], [1], [1, 2], [1, 2, 2], [2], [2, 2]]))
print(got)
print("PASS" if got == want and len(subsets_with_dup([0])) == 2 else "FAIL")
