Tap here to switch tabs
Problem
Submissions

Problem: Adjacent Increasing Subarrays Detection II

med
30 min
Try to solve the Adjacent Increasing Subarrays Detection II problem.

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 ≤2imes105\leq 2 imes 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

med
30 min
Try to solve the Adjacent Increasing Subarrays Detection II problem.

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 ≤2imes105\leq 2 imes 10^5

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