Greedy Trick | Count all 0 score to maximize
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- o(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n- o(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maxSubarrays(vector<int>& nums) {\n        int ans=nums[0]; int n=nums.size();\n        for(int i=1;i<n;i++) ans&=nums[i];\n        if(ans!=0) return 1;\n        int c=0;\n        ans=-1;\n        for(int i=0;i<n;i++)\n        {\n            if(ans==-1) ans=nums[i];\n            else ans&=nums[i];\n            if(ans==0)\n            {\n                c++; // count whenever we get a min score\n                if(i+1<n){ ans=nums[i+1]; } // move to next element\n            }\n        }\n        return c;\n    }\n};\n```
['C++']