Problem 845 · Medium
Count ascending run lengths into and descending run lengths out of every index, then join them at peaks.
Open the interactive visualisation