Search⌘ K
AI Features

Solution: Longest Strictly Increasing or Strictly Decreasing Suba

C# solution for the Longest Strictly Increasing or Strictly Decreasing Subarray problem using the Sliding Window pattern.

We'll cover the following...

Statement

Given an integer array nums, return the maximum length of a contiguous subarray that is either strictly increasing or strictly decreasing.

A subarray is strictly increasing if every element is greater than the previous element. A subarray is strictly decreasing if every element is less than the previous element.

Constraints:

  • 11 \leq nums.length 50\leq 50 ...