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], and [2,1,1]. DFS + 剪枝 class Solution { public: void DFS(vector<int>…
Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1] 找全排列,DFS的一般应用 class Solution { public: void DFS(vector<int> &num, int…