Minimum Number of Platforms
Signals to notice
Brute force first
For each train, count how many others overlap. It is a fair place to begin because it matches the surface of the question, yet it does not capture the deeper structure that makes the problem simpler.
The key insight
Sort arrivals and departures separately. Two pointers: if next event is arrival, +1 platform. If departure, -1 platform. Track the peak. Once you hold onto the right piece of information from moment to moment, the problem feels less like trial and error and more like following a shape that was there all along.
What must stay true
The minimum platforms = maximum number of simultaneously present trains. The event sweep counts active trains at every transition point. When you keep that truth intact, each local choice supports the larger solution instead of fighting it.
Easy way to go wrong
Processing arrivals and departures together without sorting them separately — sorting by event time (treating arrivals and departures as events on a timeline) gives the correct chronological order. Most mistakes here are not about syntax; they come from losing track of what your state, pointer, or structure is supposed to mean.