Pregunta de entrevista de Trimble MAPS

basically to write a binary search function