🔥VERY SIMPLE || JAVA  || BEATS 99.11% 🔥
Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n) \n# Code\n\nclass Solution {\n    public List<Boolean> prefixesDivBy5(int[] nums) {\n        L
# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(n)$$ \n# Code\n```\nclass Solution {\n    public List<Boolean> prefixesDivBy5(int[] nums) {\n        List<Boolean>list=new ArrayList<>();\n        int sum=0;\n        for(int i=0;i<nums.length;i++)\n        {\n             sum = (sum * 2 + nums[i]) % 5;\n            if(sum!=0)\n            {\n                list.add(false);\n            }\n            else\n            {\n                list.add(true);\n            }\n        }\n        return list;\n    }\n}\n```
['Array', 'Java']