WhatnotSoftware Engineer · OnsiteCodemia practiceEarliest Package Arrival Through Scheduled Carrier Hub Legs
Shipping between hubs happens only on scheduled legs (from hub, to hub, departure time, arrival time), and a package needs a fixed transfer time at every intermediate hub. Given the package's ready time at the origin, return the earliest time it can reach the destination, or -1 if it cannot.