Search
⌘K

Leetcode 2289. Steps to Make Array Non-decreasing

Given an array where, in each round, you simultaneously remove every element that is strictly less than its left neighbor, compute how many rounds are needed until the array becomes non-decreasing. The challenge is to determine for each element how many steps until (if ever) it’s deleted — typically solved with a monotonic-stack / DP approach to run in linear time for n up to 1e5.


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.