Skip to content

Commit ef387b1

Browse files
authored
Merge pull request #4056 from ChiaoY/python-0020
Update 0020-valid-parentheses.py
2 parents d2bcd42 + c92da38 commit ef387b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/0020-valid-parentheses.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
class Solution:
22
def isValid(self, s: str) -> bool:
3-
Map = {")": "(", "]": "[", "}": "{"}
3+
bracketMap = {")": "(", "]": "[", "}": "{"}
44
stack = []
55

66
for c in s:
7-
if c not in Map:
7+
if c not in bracketMap:
88
stack.append(c)
99
continue
10-
if not stack or stack[-1] != Map[c]:
10+
if not stack or stack[-1] != bracketMap[c]:
1111
return False
1212
stack.pop()
1313

0 commit comments

Comments
 (0)