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.
Sorry!
While your point is interesting, it goes without saying. Changes to the task are outside the task's scope.
This comment is hidden because it contains spoiler information about the solution
The fact that lightest's question is 3 years old and no-one has answered it may indicate that no-one here actually had such a thought process, i.e. the task was recognised as "known problem x, with known solution y" and the solution was just copied from somewhere, and all the explanations of it are canned (which is why none of them make sense from the perspective of someone who's only familiar with the task description). So, if you're like lightest (or me), don't be too disheartened if you couldn't come up with this solution from scratch from the task description. There may be only one person in the history of the world who's done that, and they may have even started from a clearer task description!
I just found the "Show Kata Test Cases" section (on this Discourse tab), and it shows that the tests do pass a negative number in the JS version.
Isn't logging the inputs outside the scope of the challenge? CodeWars showed me the inputs for the other tests.
This was in JS. Actually, I don't know that the tests were passing a negative number, only that handling them in my code solved the problem.
My solution wasn't passing the "smallest cases" tests, but I couldn't see the actual value(s) the tests were passing to my function. This is artificially unfair. Perhaps this is a problem with CodeWars rather than this kata?
Turns out the "smallest cases" tests were passing a negative number! This isn't hinted at in the instructions.
This could start on 3 and doesn't have to check every number, e.g. 4.
Sorting all the numbers just to get the smallest...
This comment is hidden because it contains spoiler information about the solution