[Hacker Earth] Number of divisorsRead more
[Hacker Earth] Maximum size of a setRead more
[Hacker Earth] Remove IntervalRead more
[Codeforces] Round 720 (Div. 2) C. Nastia and a Hidden PermutationRead more
[Codeforces] Divide by Zero 2021 and Codeforces Round 714 (Div. 2) D. GCD and MSTRead more
[Codeforces] Round 716 (Div. 2) D. Cut and StickRead more
[Codeforces] Educational Codeforces Round 109 (Rated for Div. 2) C. Robot CollisionsRead more
[Codeforces] Round 724 (Div. 2) D. Omkar and MediansRead more
[Hacker Cup 2023 Round 1] Problem C2: Back in Black (Chapter 2)Read more
[LeetCode] Maximum Length of Semi-Decreasing Subarrays

2863. Maximum Length of Semi-Decreasing Subarrays

You are given an integer array nums.

Return the length of the longest semi-decreasing subarray of nums, and 0 if there are no such subarrays.

  • A subarray is a contiguous non-empty sequence of elements within an array.
  • A non-empty array is semi-decreasing if its first element is strictly greater than its last element.
Read more