FastPrepMaximize Minimum Deployment Difficulty
Problems/Maximize Minimum Deployment Difficulty

Maximize Minimum Deployment Difficulty

JP Morgan Chase logoJP Morgan Chase● MediumFULLTIMENEW GRADOA
QuestionFunctionExamplesConstraints

Problem statement

Source note: The reported task identifies this algorithmic exercise. The executable interface, bounds, deterministic tie rules, and examples are the documented practice contract.

Distribute every module among three nonempty servers. Afterward, one difficulty d1, d2, and d3 is selected from servers 1, 2, and 3. The selected score is |d1-d2| + |d2-d3|.

For a distribution, its deployment difficulty is the minimum selected score over all allowed choices. Return the largest deployment difficulty attainable by a distribution.

Function

maximizeMinimumDeploymentDifficulty(difficulty: int[]) → int

Examples

Example 1

difficulty = [1,2,3]return = 3

Case 1 exercises the documented deterministic contract.

Example 2

difficulty = [1,2,3,7,8,15,20,21]return = 24

Case 2 exercises the documented deterministic contract.

Example 3

difficulty = [5,5,5]return = 0

Case 3 exercises the documented deterministic contract.

Constraints

  • 3 <= difficulty.length <= 200000.
  • 0 <= difficulty[i] <= 10^8.

More JP Morgan Chase problems

  • LFU CacheONSITE INTERVIEW · Seen Nov 2026
  • LRU CacheONSITE INTERVIEW · Seen Nov 2026
  • Find Total CostOA · Seen Oct 2026
All JP Morgan Chase interview questionsSee JP Morgan Chase hiring insights
Saved
class Solution {
    public int maximizeMinimumDeploymentDifficulty(int[] difficulty) {
        // Write your code here.
    }

}
Checking account…