Company: Amazon_15nov
Difficulty: medium
Maximize Server 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 ith server. To optimize server performance, a transformation process is applied to the servers based on the following sequence. The process unfolds as follows: - Start by choosing an ith server with health x = health[i]. Increment all other servers' health 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 those servers and repeat the transformation process, starting from the newly chosen server. Given an array health, determine the maximum health achievable by considering all possible permutations of the starting server. Complete the function getMaxHealth in the editor below