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.
1 is what your function wrongly returned, not the input value.
1 should equal 2
Why?
in xmpl we have: "4 --> 0 (because 4 is already a one-digit number)"
hence "1 --> 0 (because 1 is already a one-digit number)"
Why tests say: 1 should equal 2?
Closing.
It's the minimum from the previous step. It shows a continuity, what we might call an 'induction hypothesis'. If min was the minimum from the previous step, and we take the minimum between that and the number we are currently looking at, we know that what we return is the minimum over all (so far), right? So we know we will end up with the minimum of all the numbers once we're done.
But I accept your criticism about the naming.
prevMin
would have been clearer.Honestly I'm more upset about the
initial
, though.available
is so much better.Yes. But to call one of the arguments a function Math.min (), like the min - is not very cool. If you know which of arg actualy minumal, so for what we call the Math.min() ??
This comment is hidden because it contains spoiler information about the solution
Because you have an infinite loop under certain conditions. Print the input.
I don't see the typo, click reset.
So i don't know why i cought "Execution Timed Out (12000 ms)" with my way. Sweet.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
with 0 it's working too ;)