Recurrance relation with memoization. Optimal + works on small datasets
Bottom-up memoized solution, now with timing