Python Recursion + memoization issue solution


#1

Python have a recursion limit of 10^4. You have to increase it using sys module.

import sys
sys.setrecursionlimit(10**6)

After this, your solutions will get accepted.