Company: Amazon_16oct
Difficulty: medium
Get Max Health Problem Description Amazon manages a fleet of n servers in one of its global data centers. Each server has an initial health score, represented as an integer array health , where health[i] is the health of the i -th server. To optimize server performance, a transformation process is applied to the servers based on the following sequence: First, choose an i -th server with health x . Then, increase the health of all other servers by 1 unit each. In the modified health array, check if any servers have health exactly equal to x + 1 . If no such servers exist, the process ends. However, if there is at least one server with health equal to x + 1 , choose any of these servers and repeat the transformation process, starting from the newly chosen server. Given the array health , determine the maximum health achievable by considering all possible permutations of the starting server. Function Description Complete the function getmaxHealth in the editor below. getmaxHealth has the