(C++) 1018. Binary Prefix Divisible By 5
\n\nclass Solution {\npublic:\n    vector<bool> prefixesDivBy5(vector<int>& nums) {\n        vector<bool> ans; \n        int prefix = 0; \n        for (auto& x 
\n```\nclass Solution {\npublic:\n    vector<bool> prefixesDivBy5(vector<int>& nums) {\n        vector<bool> ans; \n        int prefix = 0; \n        for (auto& x : nums) {\n            prefix = (2*prefix + x) % 5; \n            ans.push_back(!prefix); \n        }\n        return ans; \n    }\n};\n```
['C']