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.
To add on, I think it's also because the pair of brackets will only be replaced with "" if the open and close brackets are in the correct order, of the same type as well as next to each other, on each iteration. By the last iteration, it should give you a "" if the bracket orderings are valid.
It's regex knowledge rather than code knowledge.
This comment is hidden because it contains spoiler information about the solution
I was wondering if someone could explain how this works, particularly if braces are out of order? For instance, if braces was "({[}])", wouldn't this code change the string to "{[}]", then to "{}"? Wouldn't this disregard the order of braces? I'm relatively new and would greatly appreciate if someone could help me out. Thanks!
Respect to the author! I hope one day I can code as well as this.