You are viewing a single comment's thread. Return to all comments →
Looks nice, but unfortunately this isn't passing, as mine either:
def is_matched(expression): d = {'{': '}', '[': ']', '(': ')'} if len(expression) % 2 != 0: return False for n, i in enumerate(expression): if i in d and n < (len(expression)/2): if d[i] != expression[len(expression)-n-1]: return False return True
I don't exactly understand why... Any help is appreciated :)
Seems like cookies are disabled on this browser, please enable them to open this website
Stacks: Balanced Brackets
You are viewing a single comment's thread. Return to all comments →
Looks nice, but unfortunately this isn't passing, as mine either:
I don't exactly understand why... Any help is appreciated :)