Skip to content

Commit 96b3c30

Browse files
authored
Update maximum-nesting-depth-of-two-valid-parentheses-strings.cpp
1 parent b0b7eb9 commit 96b3c30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/maximum-nesting-depth-of-two-valid-parentheses-strings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class Solution2 {
2121
vector<int> result(seq.length());
2222
for (int i = 0; i < seq.length(); ++i) {
2323
int point = seq[i] == '(';
24-
if ((point > 0 && A <= B) ||
25-
(point < 0 && A >= B)) {
24+
if ((point == 1 && A <= B) ||
25+
(point == -1 && A >= B)) {
2626
A += point;
2727
} else {
2828
B += point;

0 commit comments

Comments
 (0)