Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Brackets by wbl4126
def checkio(expression):
d = {']':'[', ')':'(', '}':'{'}
tmp = []
for s in expression:
if s in '[({':
tmp += s
elif s in '])}' and (not tmp or tmp and tmp.pop() != d[s]):
return False
return not tmp
April 10, 2020