C++ || Easy Video Solution || Faster than 98%
The video solution for the below code is\nhttps://youtu.be/LCmr0JJUORU\n\n# Code\n\nclass Solution {\npublic:\n    bool lemonadeChange(vector<int>& bills) {\n  
The video solution for the below code is\nhttps://youtu.be/LCmr0JJUORU\n\n# Code\n```\nclass Solution {\npublic:\n    bool lemonadeChange(vector<int>& bills) {\n        ios_base::sync_with_stdio(false);\n        cin.tie(NULL);\n        cout.tie(NULL);\n        // Note\n        // Each lemonade costs only 5$\n        // Each customer gets only one lemonade\n        // Each customer gives either 5$, 10$ or 20$ notes\n        // We need to provide change to each and every customer.\n        // 5 5 5 10 20\n        // First served\n        // Second served\n        // Third served\n        // (3 5$ coins) 10 -> 5$ (2 5$, 1 10$)\n        // Fourth custoemr --> (1 10$ and 1 5$) --> Served --> (1 5$, 1 20$) with us that will add up to 25$\n        // Give them either 3 5$ as a change\n        // Give them 1 5$ and 1 10$ as a change\n\n        int count5 = 0;\n        int count10 = 0;\n        int count20 = 0;\n        for(auto &ele : bills){\n            if(ele == 5){ count5 += 1; }\n            else if(ele == 10) {\n                if(count5 >= 1){\n                    count10 += 1;\n                    count5  -= 1;\n                } \n                else return false;\n            }\n            else{\n                if(count5 >= 1 and count10 >= 1){\n                    count5  -= 1;\n                    count10 -= 1;\n                    count20 += 1;\n                }\n                else if(count5 >= 3){\n                    count5 -= 3;\n                    count20 += 1;\n                }\n                else return false;\n            }\n        }\n        return true;\n    }\n};\n```
['C++']