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.
Comments to solutions are visible even when you have not solved the kata. You cannot see code of solution, but you can see comments when you get to solution page with a direct link, or on the front page dashboard.
As far as i know, you can't see the solutions unless you're already solve the kata. Doesn't it means that you can't see the comments to the particular solution? Please correct me, if I wrong)
Replacing "jokers" in one forward loop! It reminds me the "Eratosthenes Sieve" algorithm! Clever and fast way!
This is actually my favourite even though it seems quite expensive time ande space-wise.
Cool solution! But is it O(n^2) compared to O(n) for the stack approach?
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.
AWESOME O_O
I'm dumb, didn't think about this way
Clever solution.
marvellous
Comments to solutions are visible even when you have not solved the kata. You cannot see code of solution, but you can see comments when you get to solution page with a direct link, or on the front page dashboard.
As far as i know, you can't see the solutions unless you're already solve the kata. Doesn't it means that you can't see the comments to the particular solution? Please correct me, if I wrong)
Use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
no matter how hard you try there is always one line solution there :D
lol :o
Loading more items...