class Solution:
    def isValid(self, s: str) -> bool:
        close_open = {')':'(', '}':'{', ']':'['}
        parens = []
        
        for paren in s:
            if paren in close_open.values():
                parens.append(paren)
            else:
                if len(parens) < 1 or close_open.get(paren) != parens.pop():
                    return False
                
        return len(parens) == 0
                

ea778bfdcfa250bf7e56354a548c3315140ff16a
<mask token>

class Solution:
    <mask token>

class Solution:

    def isValid(self, s: str) ->bool:
        close_open = {')': '(', '}': '{', ']': '['}
        parens = []
        for paren in s:
            if paren in close_open.values():
                parens.append(paren)
            elif len(parens) < 1 or close_open.get(paren) != parens.pop():
                return False
        return len(parens) == 0

class Solution:
    def isValid(self, s: str) -> bool:
        close_open = {')':'(', '}':'{', ']':'['}
        parens = []
        
        for paren in s:
            if paren in close_open.values():
                parens.append(paren)
            else:
                if len(parens) < 1 or close_open.get(paren) != parens.pop():
                    return False
                
        return len(parens) == 0
                
