[JAVA] easy self-explanatory code
\n\n# Complexity\n- Time complexity: O(N)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n
\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public boolean lemonadeChange(int[] bills) {\n       int five = 0, ten = 0;\n       for(int i : bills) {\n           if(i == 5) five ++;\n           else if(i == 10) {\n               if(five > 0) {\n               five --;\n               ten ++;\n               }\n               else return false;\n           }\n           else {\n               if(ten > 0 && five > 0) {\n                   five --;\n                   ten --;\n               }\n               else if(five >= 3) \n                   five -= 3;\n               else \n                   return false;    \n           }\n       } \n       return true;\n    }\n}\n```
['Array', 'Greedy', 'Java']