Notebook
All posts
Archive
About
☀
☾
All
›
Leetcode
›
weekly-contest-505
weekly-contest-505
1 post
3956. Maximum Sum of M Non-Overlapping Subarrays I
weekly-contest-505
·
Jun 07, 2026
·
4 min read
Leetcode / weekly-contest-505
From O(m·n³) brute-force DP to O(m·n) using prefix sums and a monotonic deque to track the best subarray starts in a sliding window.