Share my 2ms java iteration solution (very simple and short)
\n    public List<List<Integer>> subsetsWithDup(int[] nums) {\n        Arrays.sort(nums);\n\t\tList<List<Integer>> result = new ArrayList<List<Integer>>();\n\t\
    \n    public List<List<Integer>> subsetsWithDup(int[] nums) {\n        Arrays.sort(nums);\n\t\tList<List<Integer>> result = new ArrayList<List<Integer>>();\n\t\tresult.add(new ArrayList<Integer>());\n\t\tint begin = 0;\n\t\tfor(int i = 0; i < nums.length; i++){\n\t\t\tif(i == 0 || nums[i] != nums[i - 1]) begin = 0;\n\t\t\tint size = result.size();\n\t\t\tfor(int j = begin; j < size; j++){\n\t\t\t\tList<Integer> cur = new ArrayList<Integer>(result.get(j));\n\t\t\t\tcur.add(nums[i]);\n\t\t\t\tresult.add(cur);\n\t\t\t}\n\t\t\tbegin = size;\n\t\t}\n\t\treturn result;\n    }
['Backtracking', 'Java']