2270. Number of Ways to Split Array
On This Page
class Solution:
def waysToSplitArray(self, nums: List[int]) -> int:
s = sum(nums)
res = t = 0
for v in nums[:-1]:
t += v
if t >= s - t:
res += 1
return res