Find missing number in an array using binary search