Recursion dictonary

my code is running fine on IDE but no test case is passing. can you tell me what i m missing in my code