Java Intuitive with Explanation O(N) beats 100%.
Firstly if an entry is not $5 then we can return false. Next greedy technique would be to return the change with maximum value. \nHence, suppose we have 3  x $5
Firstly if an entry is not $5 then we can return false. Next greedy technique would be to return the change with maximum value. \nHence, suppose we have 3  x $5 and 1 x $10, for an entry of $20 -> We would give a $10 and $5 instead of 3 x $5, which will increase the chance of more sale after 20. \n\n```\nclass Solution {\n    public boolean lemonadeChange(int[] bills) {\n        int fives = 0, tens = 0; \n        if (bills.length < 1) return true;\n        if (bills[0] != 5) return false;\n        for (int index = 0; index < bills.length; ++index) {\n            if (bills[index] == 5) \n                fives++;\n            else if (bills[index] == 10) {\n                if (fives < 1)\n                    return false;\n                fives--;\n                tens++;\n            } else {\n                if (tens > 0 && fives > 0) {\n                    tens--;\n                    fives--;\n                } else if (fives > 2) \n                    fives -= 3;\n                else return false;\n            }\n        }\n        return true;\n    }\n}\n```\n\nIf you liked the post please upvote. Any suggestions are always welcome.
['Java']