Simple O(N) time solution without binary search(Python).
\nclass Solution:\n    def waysToSplit(self, nums):\n        ans = 0\n        psum = [nums[0]]\n        for i in range(1,len(nums)):\n            psum.append(ps
```\nclass Solution:\n    def waysToSplit(self, nums):\n        ans = 0\n        psum = [nums[0]]\n        for i in range(1,len(nums)):\n            psum.append(psum[-1] + nums[i])\n        i = 0\n        j = 1\n        k = 1\n        while(i<len(psum)-1):\n            j = max(i+1,j)\n            while(j<len(psum)-1):\n                if psum[j]-psum[i] - (psum[i])>=0:\n                    break \n                j+=1\n            k = max(j,k)\n            while(k<len(psum)-1):\n                if psum[-1] - psum[k] - (psum[k]-psum[i])<0:\n                    break \n                k+=1\n            ans+=(k-j)\n            i+=1\n        return ans%(1000000007)\n```
[]