EASY SOLUTION USING ONLY ONE WHILE LOOP IN C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<bool> prefixesDivBy5(vector<int>& nums) {\n        int sum=0, i=0;\n        vector<bool> ans(nums.size());\n\n        while(i<nums.size())\n        {\n            sum=(sum*2 + nums[i]) % 5;\n            ans[i]=(sum==0 ? true : false);\n    \n            i++;\n        }\n\n        return (ans);\n    }\n};\n```
['C++']