C++ || easy and efficient
\nclass Solution {\npublic:\n    vector<bool> prefixesDivBy5(vector<int>& nums) {\n        \n        vector<bool> v1;\n        int sum=0;\n        for(int i=0;i
```\nclass Solution {\npublic:\n    vector<bool> prefixesDivBy5(vector<int>& nums) {\n        \n        vector<bool> v1;\n        int sum=0;\n        for(int i=0;i<nums.size();i++)\n        {   \n            sum+=nums[i];                 //to check for each element\n            sum*=2;                       // to convert binary to numeric form\n            if(sum%5 == 0) \n            {\n                sum = 0;                   // if divisible then make it 0\n                v1.push_back(true);\n            }\n            else\n            { \n                sum = sum%5;         //if not divisible then sum= remainder when divided by 5\n                v1.push_back(false);\n            }\n        }\n        return v1;\n    }\n};\n```\n
['C++']