Turo Interview Question

Create a memoized function. Similar to Leetcode 2623