i have been getting TLE i don’t really understand why ,ans is correct but TLE problem.
Getting TLE everytime what's wrong in my code?
please see latest code
@shubhkumar720
Hey Shubh,
To share code
a)open https://ide.codingblocks.com/
b)paste your code their
c) save it
d) share the generated link
please ignore previous link
@shubhkumar720
Hello shubh,
your recurrence relation is correct .
if u know dynamic programming(dp) then optimise ur program by using it otherwise if u are not aware of dp then leave this problem for now.when u learn dp then u can easily optimise it.
okay…beside doubt bhaiya shall i do dp first then continue graph for better understanding or continue with graph only
@shubhkumar720
just u have learnt recursion so in my opinion you should do dp first because In dp problems we first need to come up with recurrence relation (which will be easy for you now).