Problem 2012 · Medium

Sum of Beauty in the Array

Sum the beauty of each interior element, where beauty depends on comparisons with everything to its left and right. The visual tracks prefix and suffix maxima and minima.

Open the interactive visualisation