# Isn't this tricky for an easy problem?

## Метаданные

- **Канал:** NeetCode
- **YouTube:** https://www.youtube.com/watch?v=eTL3s5GImeE

## Содержание

### [0:00](https://www.youtube.com/watch?v=eTL3s5GImeE) Segment 1 (00:00 - 00:00)

A duck walked up to a lemonade stand and he said to the men run in the stand lemonade costs $5 we're given a list of customers and the bill that each customer is going to pay with and our job is to give each of them the exact change for the first customer they give us a $5 bill we owe them zero change a second customer pays with five and then a third one pays with five next a customer pays with 10 so the change that we owe them is 10 - 5 so all we need to do is give them a $5 bill now we will have two $5 bills left and we actually have a $10 bill the last customer pays with a $20 bill so we owe them $15 luckily for us we have a $10 bill and at least one $5 bill just go through all the bills if we see a five increment the number of fives same thing with the $10 bills if the change is five we need to make sure we have at least five otherwise we return false and it works beautifully

---
*Источник: https://ekstraktznaniy.ru/video/20703*