Leetcode 3505. Minimum Operations to Make Elements Within K Subarrays Equal
Compute for each length-x window the minimum L1 cost to make all its elements equal (choose the median), then pick k non-overlapping windows with minimum total cost — a DP/interval-scheduling selection problem over those window costs.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.