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.
Track the current strictly increasing run and strictly decreasing run ending at each position, and keep the longest.