1.

You are given infinite coins of denominations 5, 7, 9. Which of the following sum CANNOT be achieved using these coins?(a) 50(b) 21(c) 13(d) 23This question was addressed to me in an online quiz.This interesting question is from Coin Change Problem topic in portion Dynamic Programming of Data Structures & Algorithms II

Answer»

Right CHOICE is (C) 13

Easiest explanation - ONE way to achieve a sum of 50 is to USE ten coins of 5. A sum of 21 can be achieved by using three coins of 7. One way to achieve a sum of 23 is to use two coins of 7 and one coin of 9. A sum of 13 cannot be achieved.



Discussion

No Comment Found

Related InterviewSolutions