Ad
  • Default User Avatar

    +1 Blind4Basics
    It works for that particular set of testing cases. Just think what happens if string length is increased...
    Solution looks simple (it is pretty straightforward), but it ain't efficient.
    It's strange that many people upvoted it.
    I didn't mean it. Makes me sad.

  • Default User Avatar

    That's was in the task:

    "All input strings will be nonempty, and will only consist of open parentheses '(' , closed parentheses ')', open brackets '[', closed brackets ']', open curly braces '{' and closed curly braces '}'. "

    and MMMAAANNN is right - you can generalize.

  • Default User Avatar

    Enjoyed the Kata.

    Would suggest to add testing with big numbers (over 900000) or add element limit. This would exclude certain solutions.