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.
Yup.
Well, then the OP there should be slapped for not telling the actual reason and instead just throwing a complaint without a cause.
it's inefficient on long inputs. ;)
kudoos for not importing like nearly everyone else
This comment is hidden because it contains spoiler information about the solution
The code is short, clear and it works. What troubles you about it?
It does work - it passes the Kata tests. The Kata description could probably have been more explicit taht the string will only contain the characters '(){}[]'.
Thank you for explaining, jolaf, I think the stack concept is going to come in handy when keeping track of things that can be thought of as pairs. The dictionary pairings was a 'key' insight as well. I'm thinking this might work for higher order tuples as well. Its like counting sets, where once you have a complete set, you throw(pop) them away. Could perhaps do a left-append and left-pop as well when there are 4 of a kind. Though it probably is better to switch to an table or something like that for more complex accounting.
not stack
returnsTrue
ifstack
is empty.That should be the case at the end of the function if braces are set correctly.
In general, it works like this:
False
.Anyone want to explain how this is working? I get lost at "elif not stack or stack.pop() != b:" and I don't get how "not stack" returns True
Either you were being ironic when you all voted this up, or you are a Drumpf voter and have a loose grip on reality
adding arguements seems like cheating to me
So a list of lists can still be indexed as if it was a flat list??
Almost a triangle; I thought it was an art project; maybe codewars is becoming an artistic ai
Best documentation award