Company: Amazon_15june
Difficulty: medium
Maximize System Throughput The developers at Amazon are working on optimizing their database query times. There are n host servers, where the throughput of the i th host server is given by host_throughput[i] . These host servers are grouped into clusters of size three. The throughput of a cluster, denoted as cluster_throughput , is defined as the median of the host_throughput values of the three servers in the cluster. Each host server can be part of at most one cluster, and some servers may remain unused. The total system throughput, called system_throughput , is the sum of the throughputs of all the clusters formed. The task is to find the maximum possible system_throughput . Note: The median of a cluster of three host servers is the throughput of the 2nd server when the three throughputs are sorted in either ascending or descending order. Function Description Complete the function getMaxThroughput in the editor below. getMaxThroughput has the following parameter: int host_throughput