Simple java solution
Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n\n# Code\n\nclass Solution {\n    public int maxSubarrays(int[] nums) {\n        int val=-1,ans
# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(1)$$\n\n# Code\n```\nclass Solution {\n    public int maxSubarrays(int[] nums) {\n        int val=-1,ans=0;\n        for(int i:nums)\n        {\n            val=val&i;\n            if(val==0)\n            {\n                ans++;\n                val=-1;\n            }\n        }\n        return ans==0 ? 1 : ans;\n    }\n}\n```
['Java']