class Solution {
List<List<Integer>> data=new ArrayList<List<Integer>>();
List<Integer> temp=new ArrayList<>();
public List<List<Integer>> subsets(int[] nums) {
subfunc(nums,0);
return data;
}
void subfunc(int[] nums,int x){
data.add(new ArrayList<>(temp));
for(int i=x;i<nums.length;i++){
temp.add(nums[i]);//加入了 nums[i],对i+1之后的进行递归
subfunc(nums,i+1);
temp.remove(temp.size()-1);
}
}
}