Greedy Approach with C++ Simple
\n/*\nThe Approach is Greedy if we have max change note then change with that\nEx:- for 20 first we look for one 10\'s note if we have and one 5\'s note but if 
```\n/*\nThe Approach is Greedy if we have max change note then change with that\nEx:- for 20 first we look for one 10\'s note if we have and one 5\'s note but if we do not have 10\'s note then change with 3 5\'s notes.\n*/\n\nbool lemonadeChange(vector<int>& bills) {\n\n\t\t// variable for count of notes we have of each\n        int count5=0,count10=0,count20=0;\n        \n        for(int val:bills){\n            if(val==5)count5++;\n            if(val==10){\n                count5--;\n                count10++;\n            }\n            if(val==20){\n                count20++;\n                if(count10>0){\n                    count10--;\n                    count5--;\n                }\n                else{\n                    count5-=3;\n                }\n            }\n            \n            if(count5<0 or count10<0 or count20<0)return false;\n            \n        }\n        return true;\n        \n    }\n```
['Greedy']