HackerEarth (The Unlucky 13)?

https://www.hackerearth.com/practice/codemonk/
Please help me in the solution of The Unlucky 13,i am thinking in terms of recursion and dp but for memoization the array size is very large.

Comments (5)