We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bee601 commit 8510873Copy full SHA for 8510873
backtracking/generate_parentheses_iterative.py
@@ -9,7 +9,7 @@ def generate_parentheses_iterative(length: int) -> list:
9
4. While the stack is not empty:
10
a. Pop a partial combination and its open and close counts from the stack.
11
b. If the combination length is equal to 2*length, add it to the result.
12
- c. If open count is < length, push new combination with added '(' onto the stack.
+ c. If open count < length, push new combination with added '(' on stack.
13
d. If close count < open count, push new combination with added ')' on stack.
14
5. Return the result containing all valid combinations.
15
0 commit comments