Tag: dynamic programming algorithm
There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with …
You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that amount. You may …
On a staircase, the i-th step has some non-negative cost cost assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. You need …
Given a square array of integers A, we want the minimum sum of a falling path through A. A falling path starts at any element in the first row, …
A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ – 1 ‘B’ – 2 … ‘Z’ – 26 Given a non-empty string …