JAVA | O(N) Time and O(1) Space | Easy
\nclass Solution {\n    public int waysToSplitArray(int[] nums) {\n        long sum = 0;\n        for(int num : nums) {\n            sum += num;\n        }\n   
```\nclass Solution {\n    public int waysToSplitArray(int[] nums) {\n        long sum = 0;\n        for(int num : nums) {\n            sum += num;\n        }\n        \n        long leftSum = 0;\n        int res = 0;\n        for(int i = 0; i < nums.length-1; i++) {\n            leftSum += nums[i];\n            long rightSum = sum - leftSum;\n            if(leftSum >= rightSum) {\n                res++;\n            }\n        }\n        return res;\n    }\n}\n```
['Prefix Sum']