Java and Python Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n\n# Code\n```\nclass Solution {\n    public List<Boolean> prefixesDivBy5(int[] nums) {\n        int val = 0;\n        List<Boolean> list = new ArrayList<>();\n        for(int num : nums){\n            // % 5 to prevent integer overflow, otherwsie will need to use BigInteger\n            val = ((val * 2) + num) % 5;\n            list.add(val == 0);\n        }\n        return list;\n    }\n}\n```\n\n# Python\n\n```\ndef prefixesDivBy5(self, nums: List[int]) -> List[bool]:\n        result = list()\n        res = str(nums[0])\n        result.append(True) if int(res) == 0 else result.append(False)\n        for j in range(1, len(nums)):\n            res += str(nums[j])\n            if int(res, 2) % 5 == 0:\n                result.append(True)\n            else:\n                result.append(False)\n        return result\n```
['Python', 'Java', 'Python3']