Pergunta de entrevista da empresa Uber

The question was a double binary search.