leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

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 };