LeetCode 47. Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations.

For example,
[1,1,2] have the following unique permutations:
[
[1,1,2],
[1,2,1],
[2,1,1]
]

题目大意:返回一个数字集合构成的数字(可能有重复数字)的所有可能的唯一的全排列~

分析:先对nums排序,然后将所有全排列加入result中~