C++ || BACKTRACKING || BIT-MANIPULATION || TWO SOLUTION
BACKTRACKING\n\nclass Solution {\npublic:\n    vector<vector<int>> subsetsWithDup(vector<int>& nums) {\n        set<vector<int>> ans;\n        vector<int> list;
**BACKTRACKING**\n```\nclass Solution {\npublic:\n    vector<vector<int>> subsetsWithDup(vector<int>& nums) {\n        set<vector<int>> ans;\n        vector<int> list;\n        \n        sort(nums.begin(),nums.end());\n        \n        help(nums,list,ans,0);\n        \n        vector<vector<int>> res(ans.begin(),ans.end());\n        \n        return res;\n    }\n    \n    void help(vector<int> &nums,vector<int>& list, set<vector<int>>& ans,int start ){\n        ans.insert(list);\n       \n        for(int i=start;i<nums.size();i++){\n            list.push_back(nums[i]);\n            help(nums,list,ans,i+1);\n            list.pop_back();\n        }\n    }\n};\n```\n\n**BIT MANIPULATION**\n\n```\nclass Solution {\npublic:\n    vector<vector<int>> subsetsWithDup(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int n=nums.size(),p=1<<n;\n        set<vector<int>> ans;\n        \n        for(int i=0;i<p;i++){\n            vector<int> list;\n            for(int j=0;j<n;j++){\n                if(i&(1<<j)) list.push_back(nums[j]);\n            }\n            ans.insert(list);\n        }\n        \n        vector<vector<int>> res(ans.begin(),ans.end());\n        return res;  \n    }\n};\n```
['Backtracking', 'Bit Manipulation', 'Recursion', 'C', 'C++']