Well Commented Code & Explained Code✅⭐
Approach\nApplying AND operator on whole array will gives us the minimum value, because AND operator never sets a bit thus never increases the answer.\n\nTheref
# Approach\nApplying `AND` operator on whole array will gives us the minimum value, because `AND` operator never `sets` a bit thus never increases the answer.\n\nTherefore we find the `min` value which will either be `zero` or f `nonzero` \n\nIf it is `nonzero` the sum of two `subarray` with each subarray hacing `nonzero AND` result and sum is impossible, therfore in this case the answer would be `1`\n\nIf it is `zero` then we find number of `subarray` with `zero AND` result \n\n# Complexity\n- Time complexity:O(n)\n\n- Space complexity:o(n)\n\n# Code\n```\nclass Solution {\npublic:\n    int maxSubarrays(vector<int>& nums) {\n        int n = nums.size();\n        \n        // Initialize \'mini\' with the first element of \'nums\'\n        int mini = nums[0];\n        for(auto it: nums)\n            mini &= it; // Calculate the bitwise AND of all elements in \'nums\'\n        \n        // If \'mini\' is not zero, return 1 since there\'s at least one subarray with a score of \'mini\'\n        if(mini != 0)\n            return 1;\n        else {\n            int ans = 0, curr = nums[0];\n            \n            // Loop through \'nums\' to find subarrays with score equal to \'mini\'\n            for(int i = 0; i < nums.size(); i++) {\n                curr &= nums[i]; // Update \'curr\' by bitwise AND with the current element\n                \n                // If \'curr\' matches \'mini\', increment \'ans\'\n                if(curr == mini) {\n                    ans++;\n                    \n                    // Move to the next element if not at the end of the array\n                    if(i < n-1)\n                        curr = nums[i+1];\n                }\n            }\n            \n            return ans; // Return the count of subarrays with score \'mini\'\n        }\n        return 0; // This line is unreachable, as the function will have returned earlier\n    }\n};\n\n```
['C++']