Vivek loves array game - run time error

[giving run time error](https://ide.codingblocks.com/s/309020)

when iam simply try with recursion its working but when iam gonna try to memorise the subproblem it gives run time error. could u please help me?