언어: python3
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
length = len(nums)
result = []
for i in range(length+1):
temp = list(itertools.combinations(nums,i))
print(temp)
result += list(map(list,temp))
print(result)
return result
using built-in libraries
I found that solution is very popular and helpful: https://youtu.be/NS01_5oZn7c