🔥C++ Solution || efficient iterative solution
\n\n# Code\n\nclass Solution {\npublic:\n    int maxSubarrays(vector<int>& nums) {\n        int totalAnd = INT_MAX;  \n        \n        // calculate the bitwis
\n\n# Code\n```\nclass Solution {\npublic:\n    int maxSubarrays(vector<int>& nums) {\n        int totalAnd = INT_MAX;  \n        \n        // calculate the bitwise AND of all elements in nums.\n        for (auto num : nums) {\n            totalAnd &= num;\n        }\n        \n        // if totalAnd is not zero, return 1 as there is no way to split into subarrays with a total score of 0.\n        if (totalAnd != 0) {\n            return 1;\n        }\n        \n        int currentAnd = INT_MAX;  \n        int subarrayCount = 0;    \n        \n        for (auto num : nums) {\n            currentAnd &= num;  \n            \n            // if currentAnd becomes 0, it\'s time to split into a new subarray.\n            if (currentAnd == 0) {\n                subarrayCount++;  \n                currentAnd = INT_MAX;  \n            }\n        }\n        \n        return subarrayCount;\n    }\n};\n```
['C++']