O(N) Recursive in Erlang
Approach\n Describe your first thoughts on how to solve this problem. \nThe minimum sum of scores of the subarrays is the score of the entire nums because of th
# Approach\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe minimum sum of scores of the subarrays is the score of the entire `nums` because of the nature of `AND`. If the score of the entire `nums > 0`, then the answer is 1 because the sum of the subarrays\' scores will be always greater than 1. If the score of the entire `nums` is 0, then we can try to split `nums` into `k` subarrays `nums[0:x1], nums[x1+1:x2], ..., nums[xk:n]` and the score of each subarrays is 0. The `k` is maximized. So we perform a recursive function to calculate the maximum split of zero-score subarrays. \n\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $O(N)$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $O(N)$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n-spec max_subarrays(Nums :: [integer()]) -> integer().\nmax_subarrays(Nums) -> \n    [Ans, _] = solve(Nums),\n    max(1, Ans).\n\nsolve([]) -> [0, 16#FFFFF];\nsolve([H|T]) -> \n    [Ans, V] = solve(T),\n    case V band H == 0 of\n        true -> [Ans + 1, 16#FFFFF];\n        false -> [Ans, V band H]\n    end.\n```
['Greedy', 'Recursion', 'Erlang']