To find the minimum number of platforms needed for trains, we first sort the arrival and departure times. We use two pointers: one for arrivals and one for departures. We compare the current arrival time with the current departure time. If the arrival is earlier or equal, it means a train needs a platform, so we increase the platform count and move to the next arrival. If the arrival is later, it means a train has left, freeing a platform, so we decrease the platform count and move to the next departure. We keep track of the maximum number of platforms needed at any time. When all trains are processed, this maximum is the minimum number of platforms required to avoid waiting.