
We can model a rail network as a directed graph, where each node is a train station and each edge is a train connecting two train stations. We'll assume that each train leaves go between their stations at a regular schedule and takes a fixed amount of time
Your code should take a list of trains, ...