Company: Ring central_25july
Difficulty: medium
Efficient Tasks Problem Description You are given n software modules, where the difficulty of the i th module is represented by difficulty[i] (0 ≤ i < n). You must divide these modules among three different servers for deployment according to these rules: Each server must handle at least one module. Each module must be deployed to exactly one server. After deployment, one module will be selected from each server to calculate the overall deployment difficulty as the sum of absolute differences: |d 1 - d 2 | + |d 2 - d 3 | Here d i is the difficulty of the module selected from the i th server (1 ≤ i ≤ 3). Your task has two parts: Distribute the modules among the three servers. For each possible distribution, select one module from each server that minimizes the absolute differences formula. Among all possible distributions, determine the maximum possible value for the minimized deployment difficulty. Examples Example: difficulty = [1, 10, 5, 9] One way to divide the groups is