Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 962. Maximum Width Ramp
Find the maximum distance j - i (i < j) such that nums[i] <= nums[j] in the array — i.e., the farthest valid "ramp". With n up to 5·10^4, brute force is too slow; this is typically solved with a monotonic decreasing stack or by sorting value-index pairs to achieve near-linear or n log n time.
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.