3 Pointers , O(n) time, O(1) space [OOP] [Python]
For the three segments [s1,s2,s3], keep 3 pointers :\n1.  end of s1 / begining of s2\n2.  minimum end of s2 such sum(s2) >= sum(s1)\n3.  maximum end of S2 such 
For the three segments [s1,s2,s3], keep 3 pointers :\n1.  end of s1 / begining of s2\n2.  minimum end of s2 such sum(s2) >= sum(s1)\n3.  maximum end of S2 such sum(s2) <=sum(s3)\n\n```\nclass sumPart:\n    def __init__(self, s:int, e:int, su:0) -> None:\n        self.start = s\n        self.end =e\n        self.sum =su\n    def print(self, tag:str = \'\'):\n        print(tag,self.start,self.end,self.sum)\n\nclass Solution:\n    def waysToSplit(self, nums: List[int]) -> int:\n        limit = 10**9 + 7\n        if len(nums) <3:\n            return 0\n        s = sum(nums)\n        r=0\n        s1 = sumPart(0,1,nums[0])\n        s2 = sumPart(1,2,nums[1])\n        while s2.end<len(nums) and s2.sum<s1.sum:\n            s2.sum+=nums[s2.end]\n            s2.end+=1\n        s3 = sumPart(len(nums)-1,len(nums),nums[-1])\n        while s3.start>s2.end and s3.sum*2< (s-s1.sum):\n            s3.start-=1\n            s3.sum+=nums[s3.start]\n            \n        while  s2.end < len(nums):# s1.sum<=s2.sum: # and s2.sum<=s3.sum s3.start>=s2.end and\n            r+=max(s3.start-s2.end+1,0)\n            r%=limit\n            s1.sum+=nums[s1.end]\n            s1.end+=1\n            s2.sum-=nums[s2.start]\n            s2.start+=1\n            while s2.end < len(nums) and (s2.sum< s1.sum or s2.end==s2.start):\n                s2.sum+=nums[s2.end]\n                s2.end+=1\n            while s3.start<len(nums)-1 and (s3.sum-nums[s3.start])*2>= (s-s1.sum) :\n                s3.sum-=nums[s3.start]\n                s3.start+=1\n            \n        return r\n```
[]