class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
nums.sort()
result = []
def backtrack(j , tmp):
result.append(tmp)
for i in range(j,len(nums)):
backtrack(i+1 , tmp + [nums[i]])
backtrack(0 , [])
return result
leetcode刷题python之子集
最新推荐文章于 2022-11-20 19:21:38 发布