Simple C++ Solution || Beats 100%
IntuitionThe problem requires checking whether the binary number formed by each prefix of the given array (nums) is divisible by 5. Instead of constructing larg
# Intuition
The problem requires checking whether the binary number formed by each prefix of the given array (nums) is divisible by 5. Instead of constructing large numbers explicitly (which could lead to overflow), we can track only the remainder when divided by 5.
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(N)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    vector<bool> prefixesDivBy5(vector<int>& nums) {
        vector<bool> v;
        long long ans = 0;
        for(int ele:nums){
            ans = (ans*2+ele)%5;
            v.push_back(ans==0);
        }
        return v;
    }
};
```
['Array', 'Bit Manipulation', 'C++']