Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I remembered doing an "easier" kata with this same problem that had square brackets as well as curly braces that used this same method so I tried replicating it off memory and I ended up with something a little more complicated. Seems I forgot to include the stack.pop() in the else if statement and went a roundabout way.
All this to say that I like this method much better than the regex ones.
Yeesh, why do I always have to make things so complicated.
Ah, that makes sense. Thanks for the explanation!
This comment is hidden because it contains spoiler information about the solution
Ah, that's how you make it DRYer, thanks for this!