- LIFO: last in, first out
- stack of plates piled on top, you take out from top
- in python dynamic array counts as stack
```
# Declaration: we will just use a list
stack = []
# Pushing elements:
stack.append(1)
stack.append(2)
stack.append(3)
# Popping elements:
stack.pop() # 3
stack.pop() # 2
# Check if empty
not stack # False
# Check element at top
stack[-1] # 1
# Get size
len(stack) # 1
```
- in stack algorithm problems, parts of the input will usually interact with each other
- interacting could mean matching elements together, querying some property (i.e how far is next largest element)