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.
+1 for no one wants to deal with that regex. But I imagine plenty of people wondered how it would be done.
Cool solution! But is it O(n^2) compared to O(n) for the stack approach?
Thank you this code is very helpful specially on String manipulation.
I have learned that in the split method I can use regex on it and The \G
Yeah, this is quite clever. And if you know regex, you can kind-of understand at the first glance what's going on.
But wouldn't want to have it production. :D
My solution is muuuuuch worse, and not even close to being as cool as this one.
Hi pretty cool,
what i have to mention is, what exactly are you doing if
the use case changes and you would have to compute any string within any valid braces?
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.
This comment is hidden because it contains spoiler information about the solution
This is a really smart solution. Impressive.
Bad code.
Cool solution an much better than my own, but in no way is that "best practice".
just wow :)
nice
I agree, my first thought was to include non-english characters.
I wonder if regexes are considered "best practice" when there is a comparably easy to read
for loop
based answer?Loading more items...