Skip to content

Commit ea4ac08

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 86af7e8 commit ea4ac08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

algorithms/valid-parentheses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class Solution:
22
def isValid(self, s):
33
stack = []
4-
mapping = {')': '(', '}': '{', ']': '['}
4+
mapping = {")": "(", "}": "{", "]": "["}
55
for char in s:
66
if char in mapping:
7-
top = stack.pop() if stack else '#'
7+
top = stack.pop() if stack else "#"
88
if mapping[char] != top:
99
return False
1010
else:

0 commit comments

Comments
 (0)