Recursion using Aditya Verma concept
\nclass Solution {\npublic:\n    vector<vector<int>>ans;\n    set<vector<int>>s;\n    void solve(vector<int> ip,vector<int> op)\n    {\n        if(ip.size()==0)
```\nclass Solution {\npublic:\n    vector<vector<int>>ans;\n    set<vector<int>>s;\n    void solve(vector<int> ip,vector<int> op)\n    {\n        if(ip.size()==0)\n        {\n            if(s.find(op)==s.end())\n            {\n            \n                s.insert(op);\n                ans.push_back(op);\n                \n            }\n            return ;\n        }\n        vector <int> op1=op;\n        vector <int> op2=op;\n        op2.push_back(ip[0]);\n        ip.erase(ip.begin()+0);\n        solve(ip,op1);\n        solve(ip,op2);\n        return;\n    }\n    vector<vector<int>> subsetsWithDup(vector<int>& ip) {\n        sort(ip.begin(),ip.end());\n        vector <int> op;\n        solve(ip,op);\n        return ans;\n    }\n};\n```
[]