Java || Backtracking || Easy
\nclass Solution {\n    Set<List<Integer>> res = new HashSet<>();\n    \n    void solve(int [] nums,int n,int idx,List<Integer>temp)\n    {\n        if(idx==n)\
```\nclass Solution {\n    Set<List<Integer>> res = new HashSet<>();\n    \n    void solve(int [] nums,int n,int idx,List<Integer>temp)\n    {\n        if(idx==n)\n        {\n            res.add(new ArrayList(temp));\n            return ;\n        }\n        solve(nums,n,idx+1,temp);\n        temp.add(nums[idx]);\n        solve(nums,n,idx+1,temp);\n        temp.remove(temp.size()-1);\n    }\n    public List<List<Integer>> subsetsWithDup(int[] nums) {\n        int n = nums.length;\n        Arrays.sort(nums);\n        solve(nums,n,0,new ArrayList());\n        return new ArrayList(res);\n        \n    }\n}\n```
['Backtracking', 'Java']