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.
I chose not to put the comparison there because, by doing that, it executes that instruction on every loop iteration, which immensely slows down the total run time. Although there are 2 more lines of code, the actualy number of times that comparison is made is much, much less.
Can avoid an extra (length > max_length) comparison by having the first check in the correct part of the while loop. My newer solution demonstrates this.
surely let rather than var
This comment is hidden because it contains spoiler information about the solution