I wrote this solution for this problem and getting TLE on last test case. Can someone tell me how I can make my solution more optimal with or without DP .
Thanks in advance :);
How can I make it faster?
I wrote this solution for this problem and getting TLE on last test case. Can someone tell me how I can make my solution more optimal with or without DP .
Thanks in advance :);