Dashboard
LC #90
Subsets II
Pattern · ?AmazonGoogleMeta
Problem
Return all possible subsets of an array that may contain duplicates. No duplicate subsets.
Constraints
- 1 ≤ n ≤ 10
- -10 ≤ nums[i] ≤ 10
- May contain duplicates
Example
- Input
- nums = [1, 2, 2]
- Output
- [[], [1], [1,2], [1,2,2], [2], [2,2]]
- Why
- Duplicates exist; output must not contain duplicate subsets
Spot the pattern
Which pattern cracks it?
Hints
One at a time