Approach hintTry it first, then revealHide
Track how many $5 and $10 bills you hold. For a $20 bill, prefer giving back a $10 and a $5, because $5 bills are more useful for later customers.
Track how many $5 and $10 bills you hold. For a $20 bill, prefer giving back a $10 and a $5, because $5 bills are more useful for later customers.