Im getting tle for all test cases.I used recursion as taught in hint video.This is my code
Getting TLE when using backtracking
hi @vishal23rfx
yes recursive approach will give you TLE
as it include overlapping subproblems mean same work is repeated many times
that’s why you are getting TLE
so you have to use DP(dynamic Programming) in such scenarios
i will be more clear when you learn DP
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.