Domanda di colloquio di Uber

The question was a double binary search.