Java. LemonadeChange
\n\nclass Solution {\n    public boolean lemonadeChange(int[] bills) {\n        int five = 0;\n        int ten = 0;\n        for (int bill : bills)\n        {\n
\n```\nclass Solution {\n    public boolean lemonadeChange(int[] bills) {\n        int five = 0;\n        int ten = 0;\n        for (int bill : bills)\n        {\n            if (bill == 5) five++;\n            else if (bill == 10 && five > 0) {\n                ten++;\n                five--;\n            }\n            else if (bill == 20)\n            {\n                if (ten > 0)\n                {\n                    if (five > 0)\n                    {\n                        ten--;\n                        five--;\n                    }\n                    else return false;\n                }\n                else if (five > 2) five -= 3;\n                else return false;\n            }\n            else return false;\n        }\n        return true;\n    }\n}\n```
['Java']