Skip to content

Commit dda3067

Browse files
Update generate_parentheses_iterative.py
1 parent 8510873 commit dda3067

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backtracking/generate_parentheses_iterative.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ def generate_parentheses_iterative(length: int) -> list:
2020
A list of strings representing valid combinations of parentheses
2121
2222
Time Complexity:
23-
O(2^(2n))
23+
O(2^(2*length))
2424
2525
Space Complexity:
26-
O(2^(2n))
26+
O(2^(2*length))
2727
2828
>>> generate_parentheses_iterative(3)
2929
['()()()', '()(())', '(())()', '(()())', '((()))']

0 commit comments

Comments
 (0)