Ad
  • Custom User Avatar

    Hi eldesanclemente! I think you can try the "divide and conquer" fib algorithm. The recursive version takes much time for long numbers.

  • Default User Avatar

    try to use 'for' cycle. It works perfectly with Fibonacci and code is very easy to understand

  • Default User Avatar

    same thing happening with me, won't seem to work

  • Custom User Avatar

    The javascript control function was wrong, fixed. Remember mentioning the language when reporting a problem so we know where to look.

  • Default User Avatar

    When you return undefined from the JavaScript function, you can see the expected outputs for the two (2) fixed tests (when you click ATTEMPT) in the resulting error messages:

    With input '1999' solution produced wrong output: expected undefined to equal '20th'
    With input '2011' solution produced wrong output: expected undefined to equal '21st'
    

    After that, there are random tests.

  • Custom User Avatar

    There is no fixed test with that input in Python and the control function in the random tests returns '87th' for that input.

  • Custom User Avatar

    I interpret this to mean that the height of the window where mother is is fixed (i.e, always 1.5). Is this right?

    No, that's an example value, h is a parameter of your function, it's not a fixed value.

    Is window actually the height where the mother is? (which means that that height is not always 1.5, and, so, NOT fixed)

    Yes.

    I'm assuming the ball is dropped from h. Is this right?

    Yes.

  • Default User Avatar

    So how I understood it is. The h is anything greater than zero, window, where the mother is, value is changing and is greater than zero but less than h, and the ball is dropped from h.

  • Custom User Avatar

    You're welcome, and don't worry too much about about it.

  • Custom User Avatar

    First of all, discussion related to a specific kata should be posted in its dedicated discourse page: https://www.codewars.com/kata/515de9ae9dcfc28eb6000001/discuss/javascript .

    I just checked JS version of the kata and it works OK. The problem you see is probably caused by your solution: it passes a bunch of tests succesfully, and then, for some reason, crashes. It does not pass all tests which are there, it passes only some up to the point of the crash, and that's why you do not get any points.

    My guess is that your solution tries to allocate a very large array, exhausting all available memory.

  • Custom User Avatar
  • Custom User Avatar

    Why didn't your write in that kata's discourse instead of here? It's totally unrelated to Feature Request.

    My solution to the "Split Strings" project (using Javascript) works perfectly.

    No it doesn't, that's why you get an error message.

    When I press ATTEMPT I pass all the tests.

    You pass all the tests until the error happens. Your code is exhausting the heap's memory.

    Is there a way to appeal the verdict?

    No. You have to change your code to make it work. If you're using recursion, make sure you don't have an infinite loop.