c++ solution || easy to understand || beats 100% || 0ms || dfs
\nclass Solution {\npublic:\n    vector<vector<int>> result;\n    void solve(vector<int>& nums , int start , vector<int>& subset){\n        result.push_back(sub
```\nclass Solution {\npublic:\n    vector<vector<int>> result;\n    void solve(vector<int>& nums , int start , vector<int>& subset){\n        result.push_back(subset);\n        for(int i=start ;i<nums.size();i++){\n            if(i>start and nums[i-1] == nums[i])\n                continue;\n            subset.push_back(nums[i]);\n            solve(nums , i+1 , subset);\n            subset.pop_back();\n        }\n    }\n    \n    vector<vector<int>> subsetsWithDup(vector<int>& nums) {\n        sort(nums.begin() , nums.end());\n        vector<int> subset;\n        solve(nums, 0 , subset);\n        return result;\n    }\n};\n```\n\n**Happy coding**
['Backtracking', 'Depth-First Search', 'C']