Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
remove closed pairs while possible solution in Clear category for Brackets by Leonix
import re
non_brackets = re.compile('[^\[\]\{\}\(\)]')
closed_brackets = re.compile('\(\)|\{\}|\[\]')
def checkio(expr):
old_expr, expr = None, non_brackets.sub('', expr)
while old_expr != expr:
old_expr, expr = expr, closed_brackets.sub('', expr)
return expr == ''
July 24, 2019
Comments: