Easy 7 line Java Solution || Beats 100% || Easier Than Easy
\n\n\n# Code\nJava []\nclass Solution {\n    public boolean lemonadeChange(int[] bills){\n       int five=0, tens=0;\n       for(int bill:bills){\n        if(bi
![6c3f759d-a2ee-44bc-86a2-319fa9991c17_1718074709.4420424.jpeg](https://assets.leetcode.com/users/images/3c77d8c1-4347-4fd6-8ee3-8d5b17aa5f39_1723707356.4418795.jpeg)\n\n\n# Code\n``` Java []\nclass Solution {\n    public boolean lemonadeChange(int[] bills){\n       int five=0, tens=0;\n       for(int bill:bills){\n        if(bill==5){\n            five++;\n        }else if(bill ==10 ){\n            if(five==0) return false;\n              tens++;\n              five--;\n        }\n  else if(bill==20){\n                if(five>0 && tens>0)\n                {\n                    tens--;\n                    five--;\n                }\n                else if(five>2){\n                    five-=3;\n                }\n                else{\n                return false;\n                }\n            }\n        }\n       \n       \n       return true;\n}}\n```
['Array', 'Greedy', 'Java']