I am tring to use memoization in order to calculate catalan numbers, but it just does not seem to work, what do I need to change?
def catalan_mem(n, memo = None):if n==0:return 1if memo == None:memo = {}b=0if n not in memo:for i in range (n):b+=((catalan_mem(i),memo)[0])*((catalan_mem(n-1-i),memo)[0])memo[n]=breturn memo[n]
thank you!