← All problemsSign in

Max Change

Sam lives in a country "CoinLand" where there are n different types of coin. He wants to collect as many different types of coin as he can. Now if he wants to withdraw X amount of money from a Bank, the Bank will give him this money according to the following rule: lets say sam needs to withdraw money 'x'. 1. if X=0 no money withdrawn. 2. Let Y be the highest valued coin that does not exceed X

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start