Search
⌘K

Leetcode 2863. Maximum Length of Semi-Decreasing Subarrays

Given an integer array, return the maximum length of a contiguous subarray that satisfies the problem's "semi-decreasing" property (a relaxed/non-strictly-decreasing condition defined in the prompt). This is typically solved in O(n) by scanning with two pointers or DP, tracking monotonic runs and handling the limited breaks in decreasing order to merge segments and update the longest length.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.