Search⌘ K
AI Features

Longest Strictly Increasing or Strictly Decreasing Subarray

Try to solve the Longest Strictly Increasing or Strictly Decreasing Subarray problem.

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:

  • ...