Patterns
GT · Pattern 21
Game Theory & Minimax
Solve two-player zero-sum games where both players play optimally. Generally solved by exploring all future game states using DP or recognizing a mathematical pattern.
- Time
- O(n²) or O(1)
- Space
- O(n²) or O(1)
Spot it when
- Two players taking turns optimally
- "Predict the winner" or "Can player 1 win?"
- Game state reduces on every turn