C++ || Simple if and else || With Explanation
\nclass Solution {\npublic:\n    bool lemonadeChange(vector<int>& bills) {\n      int five=0;\n        int ten=0;\n        for(int i=0;i<bills.size();i++){\n   
```\nclass Solution {\npublic:\n    bool lemonadeChange(vector<int>& bills) {\n      int five=0;\n        int ten=0;\n        for(int i=0;i<bills.size();i++){\n            if(bills[i]==5){   \n                five++; //count number of five\n            }\n            else if(bills[i]==10){\n                if(five<1){   // we require 5 for 10 if not exist then return false\n                    return false;\n                }\n                else{      \n                    five--;    // if 5 five>0 then decrement it \n                    ten++;   // add ten\n                }\n            }\n            \n            else if(bills[i]==20){   //final case\n                //for 20  we require 15 bill for 20\n                if(ten>0 && five>0){    //case 1 ten>0 and five>0 then it is equal to 15 \n                    ten--;    //decrement it\n                    five--;      //decrement it\n                    \n                }\n                else if(five>2){ //case 2 five>3 then it is also equal to 15\n                    five=five-3;  // decrement it 3 5 which are used\n                }\n                else{\n                    return false;    //remaining case return false\n                }\n            }\n            \n        }\n        return true;\n    }\n};\n```\n![Uploading file...]()\n
['Greedy', 'C', 'C++']