Amazon Interview Question

Leet code about recursion and then how to solve it with out recursion as well.