easiest solution -beats 100%
Complexity

Time complexity:
O(n)


Space complexity:
O(1)

Code
# Complexity
- Time complexity:
O(n)

- Space complexity:
O(1)

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