scala solution
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```\nobject Solution {\n def maxSubarrays(nums: Array[Int]): Int = {\n    val mi = nums.reduce(_ & _)\n    val n = nums.size\n    def f(i: Int, cur: Int, res: Int): Int = {\n      if(i == n) res\n      else if((nums(i) & cur) != 0) f(i + 1, cur & nums(i), res)\n      else f(i + 1, Int.MaxValue, res + 1)\n    }\n    if(mi == 0) f(0, Int.MaxValue, 0) else 1\n  }\n}\n```
['Scala']