Pergunta de entrevista da empresa LogicHub

Very simple algorithm question. Hint: GeeksForGeeks