Company: amazon_23april
Difficulty: medium
Code Question 1 An AWS client has brought servers and databases from data centers in different parts of the world for their application. For simplicity, let's assume all the servers and data centers are located on a 1-dimensional line. You have been given the task of optimizing the network connection. Each data center must be connected to a server. The positions of n data centers and n servers are given in the form of arrays. Any particular data center, center[i], can deliver to any particular server destination, destination[j]. The lag is defined distance between a data center at location x and a server destination at location y is |x - y|, i.e., the absolute difference between x and y. Determine the minimum lag to establish the entire network. Function Description Complete the function getMinDistance in the editor below. getMinDistance has the following parameter(s): int center[n] : the positions of data centers int destination[n] : the positions of server destinations Returns long i