Given an integer array nums, you can remove at most
An array is considered alternating if its length is nums[0] < nums[1] > nums[2] < nums[3] ... or nums[0] > nums[1] < nums[2] > nums[3] ...).
Return the maximum length of an alternating contiguous subarray you can obtain after removing at most
Constraints:
nums.length
nums[i]
Given an integer array nums, you can remove at most
An array is considered alternating if its length is nums[0] < nums[1] > nums[2] < nums[3] ... or nums[0] > nums[1] < nums[2] > nums[3] ...).
Return the maximum length of an alternating contiguous subarray you can obtain after removing at most
Constraints:
nums.length
nums[i]