Pregunta de entrevista de Google

simple two pointer question with some binary search