← Questions

Shortest delivery route around a ring of hubs

0
AmazonCodingLast asked Jun 2026

Drone hubs sit on a ring, and you know the distance between each hub and its neighbour. The drone visits a list of destination hubs in order, and each leg takes the shorter way around the ring, clockwise or counter-clockwise. Return the total distance travelled. Precompute so each leg is answered quickly.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding