Easy c++ solution Beats 96.84% in time
\n# Intuition\n Describe your first thoughts on how to solve this problem. \nwe just store count of 5,10,20 \n\n# Approach\n Describe your approach to solving t
![Screenshot 2023-01-09 at 20-16-06 Lemonade Change - LeetCode.png](https://assets.leetcode.com/users/images/5eff008b-dbb4-48c8-8275-10a1e4ad1754_1673275575.5977314.png)\n# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nwe just store count of 5,10,20 \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nusing arr[3] to store count of 5 ,10,20 \n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\no(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nusing array of size 3\n\n\n# Code\n```\nclass Solution {\npublic:\n    bool lemonadeChange(vector<int>& bills) {\n        if(bills[0]!=5)\n        {return false;\n        \n        }\n        int arr[3];\n        int n=bills.size();\n\n        for(int i=0;i<n;i++)\n        {\n             if(bills[i]==5)\n             {\n                 arr[0]++;\n             }\n             else if(bills[i]==10)\n             {\n               arr[1]++;\n                 int x=5;\n                 if(arr[0]>=1)\n                 {\n                     arr[0]--;\n                 }\n             }\n             else if(bills[i]==20)\n             {\n                 arr[2]++;\n                 int x=15;\n                 if(arr[1]>=1)\n                 {\n                     if(arr[0]>=1)\n                     {\n                         arr[1]--;\n                         arr[0]--;\n                     }\n                     else\n                    { return false;}\n                 }\n                 else if(arr[1]<1 and arr[0]>=3)\n                 {\n                     arr[0]=arr[0]-3;\n                 }\n                 else\n                 {\n                     return false;\n                 }\n             }\n        }\n        return true;\n    }\n};\n\n```
['C++']