Design Underground System
Pair each check-in with its check-out in a hash map, then keep a running total and count per route for constant-time averages.
Pair each check-in with its check-out in a hash map, then keep a running total and count per route for constant-time averages.