子集2
class Solution { public List
> subsetsWithDup(int[] nums) { Arrays.sort(nums); int len = nums.length; List
> result = new ArrayList
>(); int[] index = new int[len]; index[0] = 1; for(int i=1;i > result, int[] index) { if(len == 0) { List element = new ArrayList<>(); result.add(element); }else { subsetsWithDup2(nums, len - index[len-1], result,index); int size = result.size(); for(int i=0;i tempElement = result.get(i); for(int j=0;j