SherlockAndCostDP Dynamic Programming solution for hackerrank problem https://www.hackerrank.com/challenges/sherlock-and-cost