A stack is Last-In-First-Out (LIFO). The last element you push is the first one you pop. Use a stack when you need to match pairs (like parentheses), track "most recent" items, or process things in reverse order. The two main stack patterns are: matching/validation (parentheses, tags), and monotonic stacks (next greater element). Both appear frequently in interviews.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/stacks/intro
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████████████████████████████████████████████████████████████