Just wrote a recursive code and memoised it,sample test cases do pass but memory limit exceeds in test 4. please help,thanks in advance:). link to my code:https://mirror.codeforces.com/contest/545/submission/94629751.
Just wrote a recursive code and memoised it,sample test cases do pass but memory limit exceeds in test 4. please help,thanks in advance:). link to my code:https://mirror.codeforces.com/contest/545/submission/94629751.