Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
realgeoffrey committed Aug 29, 2024
1 parent e44f744 commit a0b581b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6274,7 +6274,7 @@ myStack.empty(); // 返回 False
*/
var isValid = function (s) {
// 优化点性能
if (s % 2 === 1) { return false; }
if (s.length % 2 === 1) { return false; }
// 字符串是左括号就入栈,字符串是右括号则出栈对比
const stack = [];
Expand Down

0 comments on commit a0b581b

Please sign in to comment.