0047.cpp (296B)
1 class Solution { 2 public: 3 vector<vector<int>> permuteUnique(vector<int> &nums) { 4 vector<vector<int>> res; 5 sort(nums.begin(), nums.end()); 6 do { 7 res.push_back(nums); 8 } while (next_permutation(nums.begin(), nums.end())); 9 return res; 10 } 11 };