Ad
  • Custom User Avatar

    Because at the time i wrote the code i was 6th kyu and then 5th kyu katas were worth more to me
    Now being 4th they are not worth much to me ...
    i don't really care - happy that i was not crazy or stupid and was missing something trivial

  • Custom User Avatar

    It runs now. I am glad my code was good but by now the solution is worth measly 2% instead of original 15% or so...

  • Custom User Avatar

    The tests never return "NaN" so I don't understand how you got "Expected Nan".

    Neither do i. Could you try running my code as if it's another of your solutions and see if it passes?

    Thank you for your advise to avoind arrays. i will see about that. But since in all tests my function returns the right result and the tests say expected NaN, that can't have anything to do with my code, can it? If my code got overflow it would not return right results time after time...

    PS.

    var array = Array(n+1).fill(1);

    I can hardly imagine this line produce an error. this is is basic at it gets.

    Here is a screen shot: http://tinypic.com/m/jhc0at/3

  • Custom User Avatar

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

  • Custom User Avatar

    Once again, i believe there is something wrong with the test (at least for JS)
    Here is the output:

    Time: 366ms Passed: 8 Failed: 50 <- ALL Basic tests pass, And ALL random tests fail !? Always! Weird!

    Test Results:
    Basic tests
    Completed in 10ms
    Random numbers
    Log
    Input n=1 <-- just to make sure i log input. it is something which value is 1, not a string "1". Just to make sure i have a guard to test for int
    ✘ It should work for random inputs too - Expected: NaN, instead got: 8

    How could the result of 1 be NaN. All other random test say exactly the same:
    Input is a number but expected result is NaN.

    What's the deal here. Even if the tests are right and i missing something, i really want to know...

  • Custom User Avatar

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

  • Custom User Avatar

    I got your reply about the other kata and admit my ignorance and acknowledge respect for your skills and creativity :)
    The problem is that it's hard to correct my incorrect code without knowing the test input.

  • Custom User Avatar

    Have the same issues as others, all my exammple test are fine but all the random ones fail...
    This is second kata by the same author that produces strange test results

  • Custom User Avatar

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