Easy explained solution, just 7 lines | Beats 70% | c++
Intuition\nThe minimum \'AND\' can only be 0. So count all the subarrays with 0 \'AND\' separetly.\n\n# Approach\n1. Let\'s start with defining variables for co
# Intuition\nThe minimum \'AND\' can only be 0. So count all the subarrays with 0 \'AND\' separetly.\n\n# Approach\n1. Let\'s start with defining variables for counting total subarrays (total) and to check the current subarray\'s \'AND\' (curr)\n2. We iterate through the elements as to count all the subarrays with 0 \'AND\' as it is the minimumm that can occur. Let\'s not forget the condition in the question that the sum should be minimumm and the elements should be part of only one array (hence iterating once).\n3. We can greedily filter out the subarrays with 0 \'AND\' because that is the minimum contribution a subarray can make.\n4. Count the zeros and increment the total subarray count.\n5. For returning the answer. We should consider a few conditions:\n    1. 1 is the minimum split you can make (full array).\n    2. if curr == 0, you can take total as it is (minimum sum condition)\n    3. if curr != 0, it has to be taken as a separate sub-array.\n\n# Complexity\n- Time complexity:\nO(N)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int maxSubarrays(vector<int>& nums) {\n        int total = 0;\n        int curr = 0;\n        for (int i: nums) {\n            if (curr) {\n                curr &= i;\n            } else {\n                curr = i;\n                total++;\n            }\n        }\n        return max(1, total - (curr != 0));\n    }\n};\n```
['Math', 'Bit Manipulation', 'C++']