note - See the Problem Source at the vely bottom of the page for the original problem description~
In a realm where data centers and servers flourished along a mystical one-dimensional line, a wise ruler sought to optimize their connections. Each data center needed to establish a bond with a server, minimizing the lag defined as the absolute distance between their coordinates. Tasked with this quest, the ruler gathered the bravest minds to decipher the best pairings from the enchanted positions of the data centers and servers. Together, they embarked on a journey to forge connections that would ensure the smallest lag possible, bringing harmony to the kingdom's network and enhancing its magical efficiency.
ββ± πΊ Credit to Tong and txr and aikay! πΊ β°β
center = [1, 2, 2] destination = [5, 2, 4] return = 6
center = [3, 1, 6, 8, 9] destination = [2, 3, 1, 7, 9] return = 5
1 <= n <= 1051 <= center[i], destination[i] <= 109- Count Promotional PeriodsOA Β· Seen Jun 2026
- Find Maximum Total Amount (SDE I, Fungible :)Seen Jun 2026
- Get Minimum AmountOA Β· Seen Jun 2026
- Find Minimum CostOA Β· Seen Jun 2026
- Get Smallest Base SegmentOA Β· Seen Jun 2026
- Select Least Resource TasksOA Β· Seen Jun 2026
- Product Category Group SizesPHONE SCREEN Β· Seen May 2026
- Count Connected ComponentsPHONE SCREEN Β· Seen May 2026
public long findMinimumDist(int[] center, int[] destination) {
// write your code here
}