Tiles 2 problem

I am getting TLE in most cases accept one. Please help?

https://ide.codingblocks.com/s/342422

hello @rahul.gupta03111999

ur recursive solution has exponential time complexity thats why it is giving tle.
use dynamic programming to improve its time complexity