GETTING A TLE IN 369 digit dp question

I am using digit dp but i dont know why I am getting TLE.
Here is the link of my code:-