Minimum cost to reach the end of the array using recursion and dynamic programming

Given an array of different costs(which is positive integers) of size ‘N.’ And a maximum possible jump from the current index to other index is ‘K.’ We aim to find the minimum cost to reach the end of the array. Let’s take below example to understand this problem better. In the above example, starting fromRead More »

Advertisements

Coin change problem (Find all number of combinations that formed a sum amount with given denominations)

Given a set of denominations of coins and an amount, our aim is find number of combinations in which we can arrange denominations to form our input amount. Let’s understand this better with following example. We can solve this problem using below two different approaches. Recursion Dynamic Programming. Recursion Let’s divide our problem into smallerRead More »