Python straightforward bit manipulation
On each iteration, num bits shift 1 index to left while least-significant bit is A[i].\n\nclass Solution:\n    def prefixesDivBy5(self, A: List[int]) -> List[bo
* On each iteration, num bits shift 1 index to left while least-significant bit is A[i].\n```\nclass Solution:\n    def prefixesDivBy5(self, A: List[int]) -> List[bool]:\n        num = 0\n        for i in range(len(A)):\n            num = (num << 1) + A[i]\n            A[i] = num % 5 == 0\n        return A\n```\nTime complexity: O(N)\nSpace complextiy: O(1)
[]