Find the minimum total time to process all queries on a ring of drone nodes.
Unlock detailed company stats for this questionUpgrade
A company is expanding its drone delivery network, which has m nodes arranged in a ring (1-based indexing). Drone i can move to either adjacent neighbour in flyTime[i] time. Another integer array QueryList of size n is given. Starting from node 1, find the minimum total time required to process all the queries in QueryList. The solution should run in linear time.
Example: m = 3, flyTime = [3,2,1], n = 4, QueryList = [1,3,3,2]; output is 4 seconds.
Format · Online assessment.
Community answers
No answers contributed by the community yet.


