finding a dynamic programming approach for problem "hacker rank: sherlock and cost"

Revision en1, by fatemehkarimi, 2018-07-04 15:36:06

I had a hard time finding a solution to the problem "Sherlock and cost" [](https://www.hackerrank.com/challenges/sherlock-and-cost/problem)but I wasn't able to solve it. then I searched the whole internet and read the people's code. I understood what they do(i.e understand their code) but I can't understand why this algorithm is true and what is the recursion??

can anyone tell me how does its dynamic approach work?? this is the code I read for this problem

Tags #dynamic-programming, #hackerrank

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English fatemehkarimi 2018-07-04 15:36:06 692 Initial revision (published)