3523. Make Array Non-decreasing
You are given an integer array
nums. In one operation, you can select a subarray and replace it with a single element equal to its maximum value.Return the maximum possible size of the array after performing zero or more operations such that the resulting array is non-decreasing.
A subarray is a contiguous non-empty sequence of elements within an array.
1 | class Solution { |