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.
It's not optimal, you are right! But actually, it only needs to iterate through the list 4 times. The len() method in python does not need to iterate through the array to find the length, but python caches the length in an attribute!
As a 5-kyu teenage coder, this kata took me 1.5h to finish, and I learned a lot. Super hard and long!!! Probably 4 or 3 kyu kata. Appreciate the author!
I think its probably clever, but definitely not the best practice as it is hard to track the code.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is the most optimal one, only have to loop through the array 2 times.
SUPER SMART!!!