Pregunta de entrevista de Samsung Electronics

I was asked a binary search problem.