Domanda di colloquio di Stockly

a very classical binary search question