Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
11-liner: lightning solution in Speedy category for Brackets by przemyslaw.daniel
brackets = (('(', ')'), ('{', '}'), ('[', ']'))
def checkio(expression):
last = []
for i in expression:
if i in '({[':
last += [i]
if i in ')}]':
if not last or (last.pop(), i) not in brackets:
return False
return not last
Nov. 21, 2017
Comments: