Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1712. Ways to Split Array Into Three Subarrays
Count the number of ways to choose two split indices to partition the array into three non-empty contiguous subarrays (left, mid, right) such that sum(left) ≤ sum(mid) ≤ sum(right). Because nums are non-negative, prefix sums are non-decreasing, so you can use two pointers or binary searches on prefix sums to count valid mid-split ranges for each left split (answer mod 1e9+7).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.