Back to problems

Min Coins to Pay with Change Allowed

Algorithm · Snowflake · Medium

Requirements Available coin values are {1, 5, 10, 50, 100, 200}, with no limit on how many of each may be used. The required total is n. A customer is allowed to hand over more than n; in that case, the receiver gives back the precise difference using coins from that same set. Return the smallest total number of coins transferred during the transaction, counting both the payment and the returned change. Examples The payer can submit one 50-value coin, and the recipient…

Checking your access…