Pergunta de entrevista da empresa Google

simple two pointer question with some binary search