C++| EASY TO UNDERSTAND solution| Intuitive approach
Please upvote to motivate me in my quest of documenting all leetcode solutions. HAPPY CODING:)\nclass Solution {\npublic:\n    bool lemonadeChange(vector& bills
**Please upvote to motivate me in my quest of documenting all leetcode solutions. HAPPY CODING:)**\nclass Solution {\npublic:\n    bool lemonadeChange(vector<int>& bills) {\n    unordered_map<int,int> mp; \n        for(int i=0;i<bills.size();i++)\n      {\n          if(bills[i]==5)\n          {\n              mp[5]++;\n          }  \n            if(bills[i]==10)\n            {\n                if(mp[5]==0)\n                  return false;\n                else\n                {\n                    mp[10]++;\n                    mp[5]--;\n                    }\n                    }\n            if(bills[i]==20)\n            {\n                if(mp[5]==0||(mp[5]<=2)&&(mp[10]==0))\n                   return false;\n                else\n                {\n                    if(mp[5]>0&&mp[10]>0)\n                    {\n                        mp[10]--;\n                        mp[5]--;\n                        mp[20]++;\n                    }\n                    else if(mp[5]>=3)\n                    {\n                         mp[20]++;\n                    mp[5]-=3;\n                    }\n                }\n            }\n      }\n        return true;\n    }\n};
['Greedy', 'C']