Reachability in a Time-Indexed Train Schedule

You are given schedules for several trains. A train is represented by the ordered list of stations it visits; the list index is its arrival time. For example, [A, B, C] means that the train is at `A...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: