efficient and easy-to-understand solution.
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\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\n# Code\n```\nclass Solution {\n    public boolean lemonadeChange(int[] bills) {\n        //first we will take two variables which will track number of five and number ten\n        int totalFive=0;\n        int  totalTen=0;\n        for(int bill:bills){\n            if(bill==20 && (totalFive>=3||totalFive>=1&&totalTen>=1)){\n                if(totalFive>=1&&totalTen>=1){\n                      totalFive=totalFive-1;\n                      totalTen=totalTen-1;\n                }\n                else{\n                   totalFive=totalFive-3;\n                }\n            }\n            else if(bill==10&& totalFive>=1){\n                totalFive=totalFive-1;\n                totalTen=totalTen+1;\n            }\n            else if(bill==5){\n                totalFive=totalFive+1;\n            }\n            else return false;\n        }\n        return true;\n    }\n}\n```
['Array', 'Java']