90. Subsets II
Analysis: Simialr to 70. The key is to count the repetion times of number.
Alg1: DFS.
Alg2: Build as recur.
Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set).
Note: The solution set must not contain duplicate subsets.
Example:
1 | Input: [1,2,2] |
Soulution:
1 | # Alg1 |
1 | # Alg2 |