Skip to content

Commit d74d41d

Browse files
authored
Update reverse-substrings-between-each-pair-of-parentheses.py
1 parent 63af3af commit d74d41d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/reverse-substrings-between-each-pair-of-parentheses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def reverseParentheses(self, s):
1717
result = []
1818
i, d = 0, 1
1919
while i < len(s):
20-
if s[i] == '(' or s[i] == ')':
20+
if i in lookup:
2121
i = lookup[i]
2222
d *= -1
2323
else:

0 commit comments

Comments
 (0)