from itertools import combinations
class Solution:
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
k = 0
new_list= []
while k < len(nums)+1:
for c in combinations(nums, k):
new_list.append(list(c))
k +=1
return new_list
No comments:
Post a Comment