面试题 08.04. 幂集
class Solution(object):
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
res = [[]]
for num in nums:
t = res[:]
for lst in t:
temp = lst + [num]
res.append(temp)
return res