MCPcopy Create free account
hub / github.com/Hsinha11/Leetcode-solutions / subsets

Method subsets

78-subsets/subsets.py:22–27  ·  view source on GitHub ↗
(self, nums: List[int])

Source from the content-addressed store, hash-verified

20class Solution:
21
22 def subsets(self, nums: List[int]) -> List[List[int]]:
23 # nums.sort()
24 result = [[]]
25 for num in nums:
26 result += [i + [num] for i in result]
27 return result
28

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected