Domanda di colloquio di Google

simple two pointer question with some binary search