Skip to content

Commit 63af3af

Browse files
authored
Update reverse-substrings-between-each-pair-of-parentheses.cpp
1 parent 79b8de7 commit 63af3af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/reverse-substrings-between-each-pair-of-parentheses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Solution {
1616
}
1717
string result;
1818
for (int i = 0, d = 1; i < s.length(); i += d) {
19-
if (s[i] == '(' || s[i] == ')') {
19+
if (lookup.count(i)) {
2020
i = lookup[i];
2121
d *= -1;
2222
} else {

0 commit comments

Comments
 (0)