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 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).
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