J.P. Morgan Interview Question

Fibonacci sequence and a DP problem