mediumArrayGreedySorting 0 views

Minimum Score by Changing Two Elements

You are given an integer array nums.

You are given an integer array nums.

Return the minimum score after changing two elements of nums.

Minimum Score by Changing Two Elements diagram

Example 1

Input: nums = [1,4,7,8,5]

Output: 3

Example 2

Input: nums = [1,4,3]

Output: 0

Constraints

  • 3 <= nums.length <= 10^5
  • 1 <= nums[i] <= 10^9

Hints

Companies

No companies reported yet.

Discussion

Sign in to join the discussion.

Loading discussion...

Test results

No test cases yet.