When I’m trying to solve a problem that asks for optimization (Minimum, Maximum, Largest, or Smallest …) I trying to consider those algorithms and techniques:
- DP
- graph algorithm (BFS, Dijkstra, Min-Max flow, …)
- Binary Search (specially in problems contains
min of maxsormax of mins) - Data Structure (Monotonic stack, heap)
- 2 pointers
- sliding window
- Divide and conquer
- Greedy (last option)
- or some data structure that can make the brute force solution better
By practicing more questions I can easily eliminate most of them from first glance.