Data Structures & AlgorithmsVery hardICPC regional · Amazon SDE OA

Using coins of value 5, 2 and 1, what is the minimum number of coins that make the amount 11?

  1. A. 4
  2. B. 2
  3. C. 3
  4. D. 5

Correct answer: C. 3

Greedy works for this coin system: 5 + 5 + 1 uses three coins, and a DP confirms it. Using 2s before checking the remainder can cost more.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic