Skip to content

Commit d08226f

Browse files
authored
Update check-if-there-is-a-valid-parentheses-string-path.cpp
1 parent 3b532b1 commit d08226f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/check-if-there-is-a-valid-parentheses-string-path.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Solution_WA {
3636
for (int j = 0; j < size(grid[0]); ++j) {
3737
const int d = (grid[i][j] == '(') ? 1 : -1;
3838
dp[j + 1] = {min(dp[j + 1].first, dp[j].first) + d, max(dp[j + 1].second, dp[j].second) + d};
39-
// bitset pattern is like xxx1010101xxxx (in fact, it is not always true in this problem)
39+
// bitset pattern is like xxx1010101xxxx (in fact, it is not always true in this problem where some paths are invalid)
4040
if (dp[j + 1].second < 0) {
4141
dp[j + 1] = {MAX_M + MAX_N, -(MAX_M + MAX_N)};
4242
} else {

0 commit comments

Comments
 (0)