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.
Passed testcases, failed on all randoms in python
This comment is hidden because it contains spoiler information about the solution
I feel you bro :D Although i do have to admit i can't wrap my head around the whole "slap a lambda in a line and then function gangbang the sh.t out of it" :D
At least i now remember i can reverse a list with [::1] pretty handy. Still can't break down the whole zip unpack * thing. Gotta go step through it real quick :) Good job. Thanks for the inspiration. You made me grow again ;)
that is basically what i wanted to do but cleaner :D you could still reduce it by replacing res = res + with res +=
otherwise very clean
well done although using counter is still slightly slower than pure regex + comprehensions. I must admit you did better on the regex than me :D just realized after using lower i didn't need the uppercase check... also much better handling of the ' cases. Thank you for the inspiration :)
Actually math is just a tool to improve performance in programming. I agree that 90% of the time you will just use the work of the people before you who did the math, but as programmers we are problem solvers per definition. If you keep programming and challenging yourself there will come a day where there is no precut algorithm and nothing you can cobble together from the existing knowledge is efficient enough. On that day you too will contribute by doing math and creating what is needed so those learning programming after you will have even less reasons to understand math to program. Programming is math - but in a cool way :D
This comment is hidden because it contains spoiler information about the solution
No, it only returns True if cnt == 0, which means you have to close all opening ones.
Wouldn't this fail if the string has a closing parentheses before an opening one?
In my opinion this is the better solution compared to the #1 right now. Same length, similar readability but much more intuitively comprehensible.