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