algorythms
All Patterns
Pattern 21

Game Theory & Minimax

1111123413610141020i=0i=1i=2i=3

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)

Recognize it when

  • Two players taking turns optimally
  • "Predict the winner" or "Can player 1 win?"
  • Game state reduces on every turn
Progress0/3
0 solved0 attempted