Swift Solution | Time Complexity: O(N) | Space Complexity: O(1)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    func maxSubarrays(_ nums: [Int]) -> Int {\n        var numsLength = nums.count\n\n        var minValue = nums[0]\n        var index = 1\n        while index < numsLength {\n            minValue = (minValue & nums[index])\n            index = index + 1\n        }\n        \n        if minValue != 0 {\n            return 1\n        }\n\n        var totalCount = 0\n        var value = -1\n        index = 0\n\n        while index < numsLength {\n            if value == -1 {\n                value = nums[index]\n                if value == minValue {\n                    totalCount = totalCount + 1\n                    value = -1\n                }\n            } else {\n                value = (value & nums[index])\n                if value == minValue {\n                    totalCount = totalCount + 1\n                    value = -1\n                }\n            }\n            index = index + 1\n        }\n        return totalCount\n    }\n}\n```
['Swift']