Tap here to switch tabs
Problem
Submissions

Problem: Minimum Difference Between Max and Min in Three Moves

Try to solve the Minimum Difference Between Largest and Smallest Value in Three Moves problem.

Statement

You are given an integer array nums.

In one move, you can choose any element of nums and change its value to any integer.

Return the minimum difference between the largest and smallest value of nums after performing at most 33 moves.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Difference Between Max and Min in Three Moves

Try to solve the Minimum Difference Between Largest and Smallest Value in Three Moves problem.

Statement

You are given an integer array nums.

In one move, you can choose any element of nums and change its value to any integer.

Return the minimum difference between the largest and smallest value of nums after performing at most 33 moves.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9