Minimum subarray score
Intuition\n        \n        Assume the minimum subarray score is 1\n        \n        => In this case, if you split more,\n           the total score is going 
# Intuition\n        \n        Assume the minimum subarray score is 1\n        \n        => In this case, if you split more,\n           the total score is going to increase overall\n           \n           => So dont split at all, and total score will also be 1 (due to AND everything)\n           => ans = 1\n\n        Assume the minimum subarray score is 2\n        => same story\n        => ans = 1\n        \n        Assume the minimum subarray score is 0\n        => Having more subarrays with same score (0) does not increase overall score\n        => So, we try to split to get all subarrays scores 0.\n        => if not, the answer is 1. No split at all => ans = 1\n        => If we can, then good \n            => try to maximize the 0 score subarrays\n                => use greedy to end a subarray as soon as we get 0 score\n                    => if the last subarray is non zero and we have prev zero subarrays, thats ok\n                        => we can accommodate last no zero score subarray with the prev zero score subarray\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nNo extra space\n\n# Code\n```\nclass Solution {\npublic:\n    int maxSubarrays(vector<int>& nums) {\n        int cur = nums[0];\n        int ans = 0;\n        int n = nums.size();\n        for(int i = 1;i<n;i++) {\n            if(cur == 0) {\n                ans++;\n                cur = nums[i];\n                continue;\n            }\n            cur = cur & nums[i];\n        }\n        \n        if(cur == 0) return ans + 1;\n\n        // Adjust last non zero subarray with prev zero score subarray\n        if(ans >= 1) return ans;\n\n        // No split at all.\n        return 1;\n    }\n};\n```
['C++']