自己写滴,嘻嘻~~
var subsets = function(nums) {
let res=[];
backtracking(0,[],nums,res);
return res;
};
function backtracking(start,temp,nums,res){
res.push([...temp]);
for(var i=start;i<nums.length;i++){
temp.push(nums[i]);
backtracking(i+1,temp,nums,res);
temp.pop();
}
}