What is top down approach of this leetcode question?

Can anyone tell me the recursive + memorized code which is top down code of this question
their is bottom up approach available on internet but i want top down can anyone tell me the code of top down (recursion +memorization) code