Solution
C++ []\nclass Solution {\npublic:\n    vector<bool> prefixesDivBy5(vector<int>& nums) {\n        vector<bool> r;\n        int n=0;\n        for(int b : nums){\n
```C++ []\nclass Solution {\npublic:\n    vector<bool> prefixesDivBy5(vector<int>& nums) {\n        vector<bool> r;\n        int n=0;\n        for(int b : nums){\n            n = ((n<<1) | b) % 5;\n            r.push_back(n==0);\n        }\n        return r;\n    }\n};\n```\n\n```Python3 []\nclass Solution:\n    def prefixesDivBy5(self, nums: List[int]) -> List[bool]:\n        currBinary, result = 0, []\n        for bit in nums:\n            currBinary = (currBinary * 2 + bit) % 5 \n            result.append(currBinary == 0)\n        return result\n```\n\n```Java []\nclass Solution {\n    public List<Boolean> prefixesDivBy5(int[] nums) {\n    int c = 0;\n        Boolean ans[] = new Boolean[nums.length];\n        for(int i=0; i<nums.length; i++){\n            c = ((c<<1) + nums[i]) % 5;\n            ans[i] = c == 0;\n        }\n        return Arrays.asList(ans);\n    }\n}\n```
['C++', 'Java', 'Python3']