Skip to content

Commit 6a642a0

Browse files
committedDec 3, 2024
updated comment in 20
1 parent df2fda3 commit 6a642a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎0020-valid-parentheses.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class Solution {
1616
if (c == '(' || c == '[' || c == '{') { // opening parentheses
1717
stack.push_back(c);
1818
} else if (stack.empty() ||
19-
stack.back() != (c == ')' ? '(' : // cursed mapping using
20-
c == ']' ? '[' : // ternary operators
21-
c == '}' ? '{' : // with fallback
22-
c)) { // condition
19+
stack.back() != (c == ')' ? '(' : // matching closing
20+
c == ']' ? '[' : // parentheses with
21+
c == '}' ? '{' : // open parentheses
22+
c)) {
2323
return false;
2424
} else {
2525
stack.pop_back();

0 commit comments

Comments
 (0)