Skip to content

Practice Adjacent Increasing Subarrays Detection II

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#3350
LeetCode Problem

Adjacent Increasing Subarrays Detection II

Problem Statement

Find the largest k for which nums contains two adjacent, nonoverlapping subarrays of length k that are each strictly increasing. If the first starts at a, the second must start at a + k. There is no required comparison between the final value of the first subarray and the first value of the second. Return k.

Source: Adjacent Increasing Subarrays Detection II on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [2,5,7,8,9,2,3,4,3,1]
Output
3

# Example 2

Input
nums = [1,2,3,4,4,4,4,5,6,7]
Output
2

Constraints

2 <= nums.length <= 2 * 10^5
-10^9 <= nums[i] <= 10^9

Related LeetCode Problems

Practice more problems similar to Adjacent Increasing Subarrays Detection II.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.