Find all possible combinations of decodings of a number.

Given an encoding number as explained below, we aim to print all combinations of decoding strings to that input number. The encoding number is as follows. Defining a recursion for this problem is very simple. Let us see the recursion tree for the input number. Let us now write the code for this recursion algorithm.Read 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 »