128. Subsets II
Given an integer array nums, which can have duplicate entries, provide the power set.
Duplicate subsets cannot exist in the solution set. Return the answer in any sequence.
Example 1:
Input : nums = [1, 2, 2]
Output : [ [ ] , [1] , [1, 2] , [1, 2, 2] , [2] , [2, 2] ]
Example 2:
Input : nums = [1, 2]
Output : [ [ ], [1] , [2] , [1, 2] ]
Now Your Turn!
Pick the correct output for the given inputInput : nums = [1, 3, 3]
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1 <= nums.length <= 10
- -10 <= nums[i] <= 10