Pregunta de entrevista de LogicHub

Very simple algorithm question. Hint: GeeksForGeeks