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.
This comment is hidden because it contains spoiler information about the solution
This is such a helpful and clear explanation of this solution. Thank you for taking the time to write this out!
Newbie question: how do you know or find out what is faster?
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.Hi! I am trying to understand this solution. Can you explain why you chose to use data.length+25 for the while loop? Why 25? Thank you!
Thank you SOOO much! I changed my check for an empty array to input.length === 0.
I really appreciate that you gave me insight into how to figure out the problem, without just giving away what I should do. Thank you again!
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.This comment is hidden because it contains spoiler information about the solution
Thank you for these comments! Your reply and solution helped me think about this problem in a completely different way.