Pregunta de entrevista de Cognizant

Algorithm Question like logarithm and search