Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions articles/lemonade-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Before attempting this problem, you should be comfortable with:

- **Greedy Algorithms** - Making optimal local decisions at each step (prioritizing \$10 bills for \$15 change to preserve flexibility)
- **Greedy Algorithms** - Making optimal local decisions at each step (prioritizing `$10` bills for `$15` change to preserve flexibility)
- **Basic Iteration** - Processing elements sequentially while maintaining state
- **Simple Counting** - Tracking quantities of different bill denominations using variables

Expand Down Expand Up @@ -561,10 +561,10 @@ impl Solution {

## Common Pitfalls

### Using Three \$5 Bills Before One \$10 and One \$5
### Using Three `$5` Bills Before One `$10` and One `$5`

When giving \$15 change for a \$20 bill, you should prefer using one \$10 and one \$5 over three \$5 bills. The \$5 bills are more versatile since they can be used for both \$5 and \$10 change scenarios. Using three \$5 bills depletes your flexibility for future transactions.
When giving `$15` change for a `$20` bill, you should prefer using one `$10` and one `$5` over three `$5` bills. The `$5` bills are more versatile since they can be used for both `$5` and `$10` change scenarios. Using three `$5` bills depletes your flexibility for future transactions.

### Not Tracking the \$10 Bill Count
### Not Tracking the `$10` Bill Count

Some solutions only track \$5 bills, assuming \$10 bills are not useful. However, \$10 bills are essential for efficiently making \$15 change. Failing to track them means you cannot implement the optimal greedy strategy and may incorrectly return `false` when change is actually possible.
Some solutions only track `$5` bills, assuming `$10` bills are not useful. However, `$10` bills are essential for efficiently making `$15` change. Failing to track them means you cannot implement the optimal greedy strategy and may incorrectly return `false` when change is actually possible.