TLE error in top down

The bottom up approach is working fine.
But the top-down approach is throwing TLE error.
Is my memoization correct?

@sr30
hello saurabh,
intialise ur memo table with -1 because 0 can be possible answer .