Greedy coin change for powers of an integer
ID: greedy-coin-change-for-powers-of-an-integer
For an integer and , unlimited denominations admit optimal greedy algorithm. In a minimum-count solution, no smaller denomination can occur times: carrying those stamps to the next denomination reduces their count by . Thus all counts below the maximum are base- digits, whose total value is at most . The maximum-denomination count is forced to be the quotient on division by , and repeating the argument forces every greedy remainder step.
New to topics? Read the docs here!