Problem 3105 · Easy

Longest Strictly Increasing or Strictly Decreasing Subarray

Track the current strictly increasing run and strictly decreasing run ending at each position, and keep the longest.

Open the interactive visualisation