Standard DFS Java Solution
public class Solution {\n        public List<List<Integer>> subsetsWithDup(int[] nums) {\n            Arrays.sort(nums);\n            List<List<Integer>> result
    public class Solution {\n        public List<List<Integer>> subsetsWithDup(int[] nums) {\n            Arrays.sort(nums);\n            List<List<Integer>> result= new ArrayList<>();\n            dfs(nums,0,new ArrayList<Integer>(),result);\n            return result;\n        }\n        \n        public void dfs(int[] nums,int index,List<Integer> path,List<List<Integer>> result){\n            result.add(path);\n            for(int i=index;i<nums.length;i++){\n                if(i>index&&nums[i]==nums[i-1]) continue;\n                List<Integer> nPath= new ArrayList<>(path);\n                nPath.add(nums[i]);\n                dfs(nums,i+1,nPath,result);\n            }\n        }\n    }
[]