Back to problems

Minimum Delivery Cost Between Cities

Algorithm · Uber · Medium

Minimum Delivery Cost between Cities Medium · Topics · Company Tags · Hints You are given n cities numbered from 1 to n. Each city i has an integer cityBase[i] representing its base delivery fee. For any two distinct cities i and j, the standard delivery cost equals the absolute difference of their base fees: cityBase[i] - cityBase[j] . Apart from the standard service, a promotional delivery is available under one specific condition: if there is exactly one other city j such…

Checking your access…