Using a list instead of a dictionary to keep memoize the results.
Problem 18 solved.
Improvement to avoid those conditionals.