Tap here to switch tabs
Problem
Submissions

Problem: Adjacent Increasing Subarrays Detection II

Adjacent Increasing Subarrays Detection II asks you to find the greatest length of two adjacent subarrays in an integer array, with both required to be strictly increasing.

Statement

Given an integer array nums, find the maximum integer k such that there exist two adjacent subarrays of length k that are both strictly increasing.

Specifically, determine the maximum value of k for which there exists an index i such that both subarrays nums[i ... i + k - 1] and nums[i + k ... i + 2 * k - 1] are strictly increasing.

Return the maximum possible value of k.

Constraints:

  • 2≤2 \leq nums.length ≤2×105\leq 2 \times 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Adjacent Increasing Subarrays Detection II

Adjacent Increasing Subarrays Detection II asks you to find the greatest length of two adjacent subarrays in an integer array, with both required to be strictly increasing.

Statement

Given an integer array nums, find the maximum integer k such that there exist two adjacent subarrays of length k that are both strictly increasing.

Specifically, determine the maximum value of k for which there exists an index i such that both subarrays nums[i ... i + k - 1] and nums[i + k ... i + 2 * k - 1] are strictly increasing.

Return the maximum possible value of k.

Constraints:

  • 2≤2 \leq nums.length ≤2×105\leq 2 \times 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9