Ad
  • Default User Avatar
  • Default User Avatar

    While your point is interesting, it goes without saying. Changes to the task are outside the task's scope.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    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!

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    This could start on 3 and doesn't have to check every number, e.g. 4.

  • Default User Avatar

    Sorting all the numbers just to get the smallest...

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution