Brute Force TLE Python 0(n^2)
\nclass Solution:\n    def waysToSplit(self, nums: List[int]) -> int:\n        prefix = [0] * len(nums)\n        prefix[0] = nums[0]\n        for i in range(1, 
```\nclass Solution:\n    def waysToSplit(self, nums: List[int]) -> int:\n        prefix = [0] * len(nums)\n        prefix[0] = nums[0]\n        for i in range(1, len(nums)):\n            prefix[i] += prefix[i - 1] + nums[i]\n        ans = 0\n        for i in range(1, len(nums) - 1):\n            for j in range(i):\n                # mid is non-existent in this case so continue\n                if j == i:\n                    continue\n                left = prefix[j]\n                mid = prefix[i] - prefix[j]\n                right = prefix[-1] - (prefix[i])\n                \n                if left <= mid <= right:\n                    ans += 1\n        return ans\n            \n\n```\n\nWe are essentially trying out all combinations of left, mid, and right ways to split the array, whenever we see a valid combination, we increment by 1. This times out, but its worth it to look at.
['Python']