Subsets II
Given an integer array nums that may contain duplicates, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.

30:00

Subsets II
medium
Topics
Companies

Given an integer array nums that may contain duplicates, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.

Example 1:
Input: [1,2,2]
Output: [[],[1],[1,2],[1,2,2],[2],[2,2]]
Constraints:
  • 1nums.length101 \leq \text{nums.length} \leq 10

  • 10nums[i]10-10 \leq \text{nums}[i] \leq 10

Input
arr =[1,2,2]

Check index 0

Candidates

1

2

2

Current Combination

Empty

Sum: 0
Found Solutions
Variables
No variables to display
DepthFunction Call
Stack empty
0/33