Problem 845 · Medium

Longest Mountain in Array

Count ascending run lengths into and descending run lengths out of every index, then join them at peaks.

Open the interactive visualisation