( ദ്ദി ˙ᗜ˙ ) Special thanks to the friend who shared this fresh last-seen signal! (07-08-26 :D
Amazon is expanding its next-generation drone delivery network, consisting of m hubs arranged in a circular ring. Hub 1 is adjacent to Hub m. A drone can move to either adjacent hub, and the travel time between Hub i and its neighbors is given by transitionTime[i].
Amazon receives a list of priority delivery requests, where packages must be picked up or delivered to specific hubs in a given sequence, represented by the array requestedHubs of size n.
transitionTime = [3,2,1] requestedHubs = [1,3,3,2] return = 4
The drone begins its journey at Hub 1.
- The first hub to visit is Hub
1itself, so it takes0seconds to complete this step. - To move from Hub
1to Hub3, the drone has two possible routes:- Clockwise:
1 -> 2 -> 3, which takestransitionTime[1] + transitionTime[2] = 3 + 2 = 5seconds. - Counterclockwise:
1 -> 3, which takestransitionTime[1] = 3seconds. - The shorter route is the counterclockwise path, so the drone reaches Hub
3in3seconds.
- Clockwise:
- The drone is already at Hub
3, so it takes0seconds to complete this step. - To move from Hub
3to Hub2, the visible source shows the clockwise route3 -> 2, which takestransitionTime[3] = 1second.
FastPrep inferred the output 4 from the visible steps: 0 + 3 + 0 + 1 = 4. The screenshot cuts off before the official final output. If you know it, feel free to tell us and we will update it. Thanks a lot in advance! We will also improve this part if we find a clearer source later. (2026-06-24 :)
Unlock the full problem
- Full problem statement and constraints
- Worked examples, explained
- Guided hints and editorial
- Run your code on real test cases
Pro subscription, billed yearly — or $19 month-to-month. Cancel anytime.
Unlock the full problem
- Full problem statement and constraints
- Worked examples, explained
- Guided hints and editorial
- Run your code on real test cases
Pro subscription, billed yearly — or $19 month-to-month. Cancel anytime.