Ad
  • Custom User Avatar

    The most readable solution, I think. Easy to read, easy to maintain and extend.

  • Custom User Avatar

    Except some moments ('return stack.length > 0? false: true;' can be replaced by just 'return stack.length > 0;') it's a good solution usefull in real life - you parse a string despite it does contain other symbols or not.

  • Custom User Avatar

    poor real task efficiency... Only braces/parenthesis containing strings are relevant, however the objective is reached

  • Custom User Avatar

    The code is rather readable and completely satisfies the objective, but... it's not useful practically. Just send '(someText)' string as an argument and the function fails. I don't think that you would really face a task with parsing a string with only braces, parenthesis and brackets. So, it's a clever solution, but not a best practice at all.