Amazon Interview Question

write dynamic programming for recursion