Simple Solution Typescript
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```\nfunction maxSubarrays(nums: number[]): number {\n    const optimalSum = nums.reduce((acc,curr) => (acc&curr));\n    let numOfPartiions = 0;\n    let currSum = 0;\n    let currXor = -1\n    for(const num of nums){\n        currXor &= num; \n        if(currSum+currXor <= optimalSum){\n            currSum+= currXor;\n            numOfPartiions++;\n            currXor = -1;\n        }\n    }\n    return Math.max(numOfPartiions,1);\n};\n```
['TypeScript']