var subsets = function(nums) {
let answer = [];
let answers = [];
function backtrack(index, start){
if(index <= nums.length)answers.push([...answer]);
for(let i = start; i <= nums.length - 1; i++){
answer.push(nums[i]);
backtrack(index + 1, i + 1);
answer.pop()
}
}
backtrack(0, 0);
return answers;
};
06-16
258
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-20
366
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)