1.

You are given infinite coins of denominations 1, 3, 4. What is the total number of ways in which a sum of 7 can be achieved using these coins if the order of the coins is not important?(a) 4(b) 3(c) 5(d) 6I got this question in semester exam.The question is from Coin Change Problem in section Dynamic Programming of Data Structures & Algorithms II

Answer»

Correct answer is (C) 5

Explanation: A SUM of 7 can be achieved in the following WAYS:

{1,1,1,1,1,1,1}, {1,1,1,1,3}, {1,3,3}, {1,1,1,4}, {3,4}.

THEREFORE, the sum can be achieved in 5 ways.



Discussion

No Comment Found

Related InterviewSolutions