faisal_sohail's blog

By faisal_sohail, history, 4 years ago, In English

hello there, i am facing problem in solving dp using top down approach.

`problem 1`

i tried to solve this problem using DP Top down approach (recursively with memoization). got Accepted when submitted this_solution while it gave TLE for other_solution i tried to figure out the reason behind but failed . curious to know, why my second solution gave TLE. ``

` problem 2:`

i tried to solve this_problem of Atcoder using top_down approach,but it shows TLE for two sub-tasks> my_solution_link am i missing any edge case or it just because of recursion or Python?

any help is highly appreciated. along with that i will be glad if u would do code review and suggest ways to make my coding more effective and readable

Thanks a ton in advance. Happy coding

  • Vote: I like it
  • -1
  • Vote: I do not like it

| Write comment?