Ad
  • Custom User Avatar

    Sorted! had to return the recursive call, a bit smarter now :D.. Cheers guys :)..

  • Custom User Avatar

    That test is 10E11. I've removed it from all languages and updated description to indicate that tests will be up to 10E8.

  • Custom User Avatar

    Well, exactly the same way how others did it with recursion! ;) Idea is to reduce the amount of identical recursive (or any other) calls and "merge" them somehow into a single one, no matter if it's done with recursion or not.

  • Custom User Avatar

    Hi, I wonder, if you send in input of a number that's 100000000000. How do you expect it to be solved via recursion ?

  • Custom User Avatar

    yep I guess I'm doing some basic mistake that I haven't figured out yet, but got some hints from you.. let me think about it a bit longer, problem must be on my side as no one else reporting this issue.. Thank you both, I'll confirm once solved :D.

  • Custom User Avatar

    You're probably not returning the recursive call to your function.

  • Custom User Avatar
  • Custom User Avatar

    Thank you for reply.
    Nah, I have this inside my code..

        console.log(result);
        return result;
    

    So it's returning as well..

  • Custom User Avatar

    You're supposed to return the stuff which you consider as your answer, you're logging them right now.

  • Custom User Avatar

    What am I doing wrong? When I console.log the result is correct, but the test response is undefined :-/. Thank you..

    Time: 941ms Passed: 0 Failed: 4 Exit Code: 1
    Test Results:
    Basic tests
    Log
    [ 6, 7 ]
    Expected: [6, 7], instead got: undefined
    Log
    [ 0, 1 ]
    Expected: [0, 1], instead got: undefined
    Log
    [ 0, 1 ]
    Expected: [0, 1], instead got: undefined
    Log
    [ 2, 2 ]
    Expected: [2, 2], instead got: undefined
    Completed in 5ms
    STDERR
    Unhandled rejection TestError: Expected: [6, 7], instead got: undefined