3349. Adjacent Increasing Subarrays Detection I
Given an array
numsofnintegers and an integerk, determine whether there exist two adjacent subarrays of lengthksuch that both subarrays are strictly increasing. Specifically, check if there are two subarrays starting 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
trueif it is possible to find two such subarrays, andfalseotherwise.A subarray is a contiguous non-empty sequence of elements within an array.
1 | class Solution { |