1712. Ways to Split Array Into Three Subarrays
https://leetcode.com/problems/ways-to-split-array-into-three-subarrays
Description
A split of an integer array is good if:
The array is split into three non-empty contiguous subarrays - named
left
,mid
,right
respectively from left to right.The sum of the elements in
left
is less than or equal to the sum of the elements inmid
, and the sum of the elements inmid
is less than or equal to the sum of the elements inright
.
Given nums
, an array of non-negative integers, return the number of good ways to split nums
. As the number may be too large, return it modulo 109 + 7
.
Example 1:
Example 2:
Example 3:
Constraints:
3 <= nums.length <= 105
0 <= nums[i] <= 104
ac
Last updated