Ad
  • Custom User Avatar

    JS: Node v12 should be used along with the appropriate assertion tools (Mocha + Chai)

  • Custom User Avatar

    A[1...n-1]

    So is it zero-indexed or one-indexed?

  • Custom User Avatar

    The random tests aren't random, they all always expect -1. Even better, they also accept undefined ?!?

  • Custom User Avatar

    The description should say what to do if there is no magic in the array (-1 should be returned).

  • Custom User Avatar

    I think it needs test for zero index, e.g. findMagic([0, 5, 5]) === 0.

    I'm not sure about that because the description says array A[1...n-1].
    Why the first index in the array is 1?
    Does it mean that magic index is always >= 1?
    If so, it should be more clear.