LogicHub interview question

Very simple algorithm question. Hint: GeeksForGeeks