i am getting TLE , i even thought using dp is a must hence failing 2 TC’s.
How to avoid TLE , even though used optimised approach
I am sorry but I can’t see you use dp. Your dp array isn’t getting filled anywhere.
Please see this bottom up approach https://ide.codingblocks.com/s/209050 and see if your code is doing the same.
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.