Perhaps there are a few people who haven't yet learned about Cartesian Tree
— this curious data structure allows many interesting uses and actually is very simple! Years ago I read about it here at CodeForces, but felt slightly confused/horrified and put it aside. Very silly :)
Returning to it years ago I created small exercise which could be solved, perhaps, in 15 minute — to help learning the idea, so to say, "practically". Here it is: Cartesian Tree Visualization — feel free to skip the intro about Descartes (kinda local joke).