You are viewing a single comment's thread. Return to all comments →
My answer in Python
def isBalanced(s): pattern = r"\{\}|\(\)|\[\]" while re.search(pattern, s): s = re.sub(pattern, "", s) if s: return "NO" else: return "YES"
Seems like cookies are disabled on this browser, please enable them to open this website
Balanced Brackets
You are viewing a single comment's thread. Return to all comments →
My answer in Python