47. Permutations II
DFS problem. Same as 46, just to make sure at one level do not repeat duplicates.
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
Example:
1 | Input: [1,1,2] |
Soulution:
1 | # dfs solution |
1 | # use recursion to build all the possible set simultaneously. |