0962. Maximum Width Ramp
https://leetcode.com/problems/maximum-width-ramp
Description
A ramp in an integer array nums
is a pair (i, j)
for which i < j
and nums[i] <= nums[j]
. The width of such a ramp is j - i
.
Given an integer array nums
, return the maximum width of a ramp in nums
. If there is no ramp in nums
, return 0
.
Example 1:
Example 2:
Constraints:
2 <= nums.length <= 5 * 104
0 <= nums[i] <= 5 * 104
ac
Last updated