Solution for Valid Parentheses problem which is a part of Grind 75 list.
class Solution:
def isValid(self, s: str) -> bool:
mapping = {'(':')', '{':'}', '[':']'}
stack = []
for char in s:
if char in mapping:
stack.append(char)
continue
if not stack or mapping[stack.pop()] != char:
return False
return not stack