递归
class Solution:def __init__(self):self.nums Noneself.size Noneself.res []def dfs(self, ans, x0):if ans.copy() not in self.res:self.res.append(ans.copy())for i in range(x, self.size):ans.append(self.nums[i])self.dfs(ans, i 1)ans.pop()def subsetsWi…