Ad
  • Custom User Avatar

    This solution is faulty, it could return null instead of proper result.

    For instance given the following array [-3, 3, 5, 9, 1] - it'll stumble on the first pair of elements, break out from the loop before reaching the element with a value of 1 end return null.