Ad
  • Custom User Avatar

    This solution works. But I think shouldn't be considered as best practices or clever solution since can be optimized

  • Custom User Avatar

    It was not eazy, but very interesting!

  • Custom User Avatar

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

  • Custom User Avatar

    JavaScript - can anyone please explain the final test? The instructions say that an empty array should be returned if N is NaN or < 1.
    What value is N on the last test? I have tried logging it out and I am only getting 0 or 2 which makes no sense.

  • Custom User Avatar

    emmm... i feel like a fool.

  • Custom User Avatar

    Look at begining of your function. Empty array is {}

    {{}} - array containing 1 empty array.

    ;)

  • Custom User Avatar

    Thank you so much for this comment! I was utterly confused when:

    • The test header said "Should return -1"
    • The actual output suggested the expected result was []
    • The input seemed to be 2 based on console logging (which was already tested further up and handled correctly)

    I would've never been able to guess a non-integer was the problem based on the information made available to me by the test. Bad form.

  • Custom User Avatar

    setup should specify whether frog can jump out of either side of the array or not.

  • Custom User Avatar

    invalid input I got was:
    -1
    0
    -101

  • Custom User Avatar

    I think the task condition is written incorrectly. "A frog cannot jump out of an array" how to understand how many jumps it should do to understand that it still cannot jump out of an array??!!! my stack was overloaded because the frog could jump back and forth endless for given condition [1,-1]

  • Custom User Avatar

    approved

  • Custom User Avatar

    approved

  • Custom User Avatar

    C translation 🐸 (author gone)

  • Custom User Avatar

    approved

  • Custom User Avatar

    what kind of invalid input in C++?
    i always got UB when testing with your invalid input...

    UndefinedBehaviorSanitizer:DEADLYSIGNAL
    ==1==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000042c63d bp 0x000000000000 sp 0x7ffdb21ad290 T1)
    ==1==The signal is caused by a READ memory access.
    ==1==Hint: address points to the zero page.
    ==1==WARNING: invalid path to external symbolizer!
    ==1==WARNING: Failed to use and restart external symbolizer!

  • Loading more items...