Problem 716 · Hard
A stack that can also report and remove its largest value, preferring the most recent of equal values.
Open the interactive visualisation