79510613

Date: 2025-03-15 04:09:23
Score: 1.5
Natty:
Report link

I recall a question from Introduction to Algorithms (CLRS, 3rd Edition) that addresses this. (Problem 16-1)

The greedy solution works when the coins are in the denominations c0, c1 , .. ck where c and k both are integers and c > 1 and k >= 1

Thus if we have the denominations {1, 5, 25} greedy would always give us an optimal solution, but if we have the denominations as {1, 15, 25} the greedy approach fails.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Rishabh