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.
pythonic sugar syntactic
It's not faster, if you run the code, you'll notice that the time varies a lot between one and the other, sometimes one is faster and sometimes the other, and endswith is written in C for performance.
In the first case you are comparing a character to a string. In the second case you are creating a completely new string only to compare it while this solution just iterates over the characters (which is of course faster than creating a new string).
I feel dumb seeing your solution. You made it look so easy! Very clever
well, nobody can say your variable names are too vague
It's really quite simple, actually : look at the fork.
Edit : similar solution (except that I used 128 instead of 1000)
This comment is hidden because it contains spoiler information about the solution
Why is using
list
as a variable name voted best practice?This comment is hidden because it contains spoiler information about the solution
wat
This comment is hidden because it contains spoiler information about the solution
what the heck
This comment is hidden because it contains spoiler information about the solution
this method is actually faster than the "best practice" solution