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.
Lol. I did same thing
return True if cnt == 0 else False
is an anti-pattern. Should just be
return cnt == 0
Last if statement can be part of elif block --> only validate if you have subtracted
The dificulties could differ from one to the other language
I'm delighted with myself that I've finally written the same function as best practice example!
But the Kata was too easy for 5kyu. Feels like 7kyu
I'm sure, it's best practice, cause it's easy to read and it doesn't use bad practices, like an example above.
It is better to write
return False
thanbreak
.Yep! Thats what I did. I do like the current top one more, but yaknow, it works.
i indicates an iteration in this case as well.
for i in string:
This is exactly what an iteration is. You iterate over an iterable. In this case that iterable is a string.