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.
don't waste your time..
I really don't want to be harsh but it may not be clear to those not in the know that this is a really really horrible solution.
while(data.length > 0)
. I'm going to assume that he just gave 25 so that his loop would iterate answers up to 25 bytes long.. his solution will always iterate at least 25 times, and for data with more than 25 bytes, his solution is not guaranteed to work.Use
console.log(input);
as the first line of your function and you'll see the problem.input === []
is not the way to check if input is an empty array.