Pregunta de entrevista de Flipkart

A binary search question with a complex test case.