Tap here to switch tabs
Problem
Submissions

Problem: Maximum Length of Semi-Decreasing Subarrays

Try to solve the Maximum Length of Semi-Decreasing Subarrays problem.

Statement

Given an integer array nums, return the maximum length of a semi decreasing subarray. If no such subarray exists, return 00.

A subarray starting at index l and ending at index r is considered semi decreasing if l << r and nums[l] >> nums[r]. The length of this subarray is r −- l ++ 11.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Length of Semi-Decreasing Subarrays

Try to solve the Maximum Length of Semi-Decreasing Subarrays problem.

Statement

Given an integer array nums, return the maximum length of a semi decreasing subarray. If no such subarray exists, return 00.

A subarray starting at index l and ending at index r is considered semi decreasing if l << r and nums[l] >> nums[r]. The length of this subarray is r −- l ++ 11.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

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