classSolution{public:boollemonadeChange(vector<int>& bills){int five =0, ten =0;for(int i =0; i < bills.size(); i++){if(bills[i]==5){
five++;}if(bills[i]==10){
ten++;if(five <=0)returnfalse;
five--;}if(bills[i]==20){if(ten >0){
ten--;if(five <=0)returnfalse;
five--;}elseif(ten <=0){if(five <3)returnfalse;
five -=3;}}}returntrue;}};