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.
Hmmmm now I got it. Smart indeed, need to think of that next time. Now it seems so dumb to me. Thanks for the interesting website as well and the quick responses.
Copy the code here: https://pythontutor.com/visualize.html#mode=edit and try with those 2 input values to see how it works.
I don't get it because ")(" is the same characters as "()" and that returns zero.
It works because the cnt variable will be negative and will return false inside the for loop.
akar-0 was trying to help you and he just wrote a cordial message and behaved in a civilised way as should anyone in comment sections.
Seems a little easy for a 5 kyu.
That shouldn't work, because the when you have ")(" in your string, it's invalid, even thought the count is equal to 0.