What's wrong with this code

its showing tle…please improve this code

Reduce the number of states in this dp to just 1 and you will pass the time limit. See that your answer does not actually depend on m but jusst on n for a particular (n,m)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.