Medium

Quiz

#90 Subsets II

APPROACH

Integer array nums may contain duplicates. Return all possible subsets (the power set) with no duplicate subsets included. Results may be in any order.

Example 1:

Input: nums = [1,2,2]
Output: [[],[1],[1,2],[1,2,2],[2],[2,2]]

Example 2:

Input: nums = [0]
Output: [[],[0]]
1 of 4
1:00

What is the optimal approach for this problem?