USING unordered_map | SIMPLE SOLUTION | EASY EXPLANATION
IntuitionKeep track of bills and see if you have enough change to give cutomers.Complexity
Time complexity: O(n)

Space complexity: O(1)
Approach
Initialize a d
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Keep track of bills and see if you have enough change to give cutomers.

# Complexity 
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Approach
<!-- Describe your approach to solving the problem. -->
- Initialize a dictionary to track the number of 5, 10, and 20 dollar bills on hand.
- Then iterate through the list of bills received, updating the dictionary accordingly.
- For each 10 bill, checks if there is at least one 5 bill to provide change.
- For each 20 bill, checks if there is either one 10 bill and one $5 bill, or at least three 5 bills, to provide change.
- If at any point the cashier cannot provide change for a customer, the function returns False; otherwise, it returns True.


# Code
```cpp []
class Solution {
public:
    bool lemonadeChange(vector<int>& bills) {
        unordered_map <int,int> umap;
        for(int i=0; i<bills.size(); i++)
        {
            if(bills[i] == 5)
                umap[5]++;
            else if(bills[i] == 10)
            {
                umap[10]++;
                if(umap[5] == 0) return false;
                umap[5]--;
            }
            else
            {
                umap[20]++;
                if(umap[10] > 0 && umap[5] > 0)
                { umap[10]--, umap[5]--; }
                else if(umap[5] > 2) umap[5] -=3;
                else return false;
            }
        }

        return true;
    }
};
```
['C++']