[leetcode-20] Valid Parenthese
ยท
๐ข One step
LeetCode-20 Valid Parentheses : Given a string s containing just the characters (, ), {, }, [ and ], determine if the input string is valid. note : s consists of parentheses only ()[]{}Answer :::python class Solution: def isValid(self, s: str) -> bool: valid = [] dict_valid = { "}":"{", "]":"[", ")":"(" } for l in s: if l not in dict_valid: valid.append(l) elif not valid or dict_valid[l] != vali..