Given a nums consisting of unique values.
For each index i, determine the length of the longest contiguous subarray where nums[i] is the maximum element.
Return an array ans of the same length, where ans[i] is the length of this maximal subarray for the element at index i.
Constraints:
nums.length
nums[i]
All elements in nums are distinct.
Given a nums consisting of unique values.
For each index i, determine the length of the longest contiguous subarray where nums[i] is the maximum element.
Return an array ans of the same length, where ans[i] is the length of this maximal subarray for the element at index i.
Constraints:
nums.length
nums[i]
All elements in nums are distinct.