I Understood Monotonic Stacks When I Stopped Thinking About Stacks

Avinash Tyagi
I've been working through coding problems that I can understand when reading solutions but struggle to solve on my own. This series is about breaking down the "why does this actually work" part. Not tutorials. Just honest breakdowns of where my thinking got stuck and what finally unstuck it. The problem LeetCode 907: Sum of Subarray Minimums. Given an array, find the minimum of every contiguous subarray, and return the sum of all those minimums. I could solve this in O(n²) almost immediately. Tw