Binary search problem


my code is not passing all test cases please look into it

move the return -1 line after the while loop ends