Google Interview Question

Some basic loop/recursion