There are vehicles that travel between stations on a predefined daily schedule. Each station has a capacity of maximum number of vehicles that can be present at a single point in time. Also each connection between stations also has a capacity.
The task is to write a function that given schedules of vehicles, and station and segment capacities , determine if this satisfies the capacity of stations and the connecting segment.
ie. given an input list of schedules of vehicles travelling during the day, and a , write a program to find if there is a point in time when either some station's or some segment's between station capacity is exceeded, and return true if no such point is found.
Feel free to make assumptions on data structures for storing schedules and capacities from the input, in your choice of language, but we would require the source code as well as some unit tests.