Skip to content

Commit 3f61aee

Browse files
committed
updated
1 parent 0e74b01 commit 3f61aee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

data_structures/hashing/subsets_iterative.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def generate_subsets(nums: list[int]) -> list[list[int]]:
5555
def backtrack(start: int, current: list[int]) -> None:
5656
# Add the current subset to the result list
5757
result.append(current[:])
58+
print(f"current: {current}")
5859

5960
for i in range(start, len(nums)):
6061
# Include nums[i] in the current subset
@@ -67,7 +68,7 @@ def backtrack(start: int, current: list[int]) -> None:
6768
result: list[list[int]] = []
6869
backtrack(0, [])
6970
return result
70-
71+
print(generate_subsets([1, 2, 3])) # Output: [[], [1], [1, 2], [1, 2, 3], [1, 3], [2], [2, 3], [3]]
7172

7273
def search(k: int, n: int, subset: list[Any], all_subsets: list[list[Any]]):
7374
"""

0 commit comments

Comments
 (0)