3350. Adjacent Increasing Subarrays Detection II
Given an array
numsofnintegers, your task is to find the maximum value ofkfor which there exist two adjacent subarrays of lengthkeach, such that both subarrays are strictly increasing. Specifically, check if there are two subarrays of lengthkstarting at indicesaandb(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 { |