3350. Adjacent Increasing Subarrays Detection II
Given an array
nums
ofn
integers, your task is to find the maximum value ofk
for which there exist two adjacent subarrays of lengthk
each, such that both subarrays are strictly increasing. Specifically, check if there are two subarrays of lengthk
starting at indicesa
andb
(a < b
), where:
- Both subarrays
nums[a..a + k - 1]
andnums[b..b + k - 1]
are strictly increasing.- The subarrays must be adjacent, meaning
b = a + k
.Return the maximum possible value of
k
.A subarray is a contiguous non-empty sequence of elements within an array.
1 | class Solution { |