Back to problems

Drone Delivery on a Hub Ring — Minimum Travel

Algorithm · Amazon · Medium

Requirements There are m hubs arranged in a circular ring and numbered from 1 through m. The final hub is adjacent to Hub 1. requestedHubs gives the destinations that must be visited, in order. transitionTimes[i - 1] is the time to traverse the clockwise edge from Hub i to the next hub on the ring, with transitionTimes[m - 1] representing the edge from Hub m to Hub 1. The drone begins at Hub 1. For each requested destination, it may move in either direction around the ring…

Checking your access…