Problem
1. Given a set of distinct integers, S, return all possible subsets.
2. Given a collection of integers that might contain duplicates, S, return all possible subsets.
[ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], [] ]
2. For example, if S = [1,2,2], a solution is:
[2], [1], [1,2,2], [2,2], [1,2], [] ]
Note:
- Elements in a subset must be in non-descending order.
- The solution set must not contain duplicate subsets.
No comments:
Post a Comment