LogicHub Interview Question

Very simple algorithm question. Hint: GeeksForGeeks