Question d’entretien chez Google

simple two pointer question with some binary search