Monotonic stack
Keep a stack in sorted order to find the next greater or smaller element for every position in one pass.
Solved
0/6
1Next Greater Element Imonotonic stack · next greaterEasy2Daily Temperaturesmonotonic stack · next greaterMedium3Online Stock Spanmonotonic stack · previous greaterMedium4Remove K Digitsmonotonic stack · greedyMedium5Sum of Subarray Minimumsmonotonic stack · contribution countingMedium6Largest Rectangle in Histogrammonotonic stack · previous/next smallerHard