Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2945. Find Maximum Non-decreasing Array Length
Given a positive-integer array where you may replace any contiguous subarray by its sum, find the maximum number of contiguous segments you can partition the array into so that the sequence of segment sums is non-decreasing. With n up to 1e5, this reduces to greedily merging adjacent elements/segments until the sequence of segment sums becomes non-decreasing.
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.