class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
res = []
candi = []
def dfs(idx):
if idx == len(nums):
res.append(candi.copy())
return
dfs(idx+1)
candi.append(nums[idx])
dfs(idx+1)
candi.pop(-1)
dfs(0)
return res