Greedy
Intuition\nIf we do AND of two number, they will always decrease. Hence the minium will always be either 0 or the AND of complete array.\n\n# Approach\nKeep doi
# Intuition\n**If we do `AND` of two number, they will always decrease.** Hence the minium will always be either `0` or the `AND` of complete array.\n\n# Approach\nKeep doing the `AND` for the array, stop only when we get a zero.\n\n>### Corner Case\n>**What if the last number remaining is $>0$ ?**\n*If the size of the split is $>1$ this means that there had been a zero before the current `AND` chain, hence we merge it with that particular chain $-$ `splits=splits-1`*\n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n    int maxSubarrays(vector<int>& nums) {\n        int splits = 1, res = nums[0], len = nums.size();\n        for (int i = 0; i < len; i++) {\n            res = res & nums[i];\n            if (res == 0) {\n                splits += (i + 1 < len);\n                if (i + 1 < len)\n                    res = nums[i + 1];\n            }\n        }\n        if (res != 0 && splits > 1)\n            splits--;\n\n        return splits;\n    }\n};\n```
['C++']