Skip to content

Commit db27e06

Browse files
authored
Update maximum-nesting-depth-of-two-valid-parentheses-strings.cpp
1 parent a86d606 commit db27e06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Solution2 {
2020
int A = 0, B = 0;
2121
vector<int> result(seq.length());
2222
for (int i = 0; i < seq.length(); ++i) {
23-
int point = seq[i] == '(';
23+
int point = seq[i] == '(' ? 1 : -1;
2424
if ((point == 1 && A <= B) ||
2525
(point == -1 && A >= B)) {
2626
A += point;

0 commit comments

Comments
 (0)