java solution | 100% efficient
\nclass Solution {\n    func prefixesDivBy5(_ nums: [Int]) -> [Bool] {\n        var divisibleByFive = [Bool]()\n        var n = 0\n        for bit in nums {\n  
```\nclass Solution {\n    func prefixesDivBy5(_ nums: [Int]) -> [Bool] {\n        var divisibleByFive = [Bool]()\n        var n = 0\n        for bit in nums {\n            n = (n * 2 + bit) % 10\n            divisibleByFive.append(n == 5 || n == 0)\n        }\n        return divisibleByFive\n    }\n}\n```
['Swift']