✅ Simple Solution | cpp
Intuition\n Describe your first thoughts on how to solve this problem. \nIntuition is that smallest AND will be equal to AND of whole array\nthere cannot be any
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nIntuition is that smallest AND will be equal to AND of whole array\nthere cannot be any subarray whose AND is less than AND of array\nso if array AND is > 0 then ans == 1\nelse we can count subarrys with AND = 0.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    int maxSubarrays(vector<int>& nums) {\n        int min = INT_MAX,n = nums.size(),count = 0;\n        for(int i=0;i<n;i++)\n        {\n            min&=nums[i];\n        } \n        if(min != 0)\n        {\n            return 1;\n        }\n        int running = INT_MAX;\n        for(int i=0;i<n;i++)\n        {\n            running&=nums[i];\n            if(running == 0)\n            {\n                count++;\n                running = INT_MAX;\n            }\n        }\n        return count;\n    }\n};\n```
['C++']