You are given an integer array nums.

Return the minimum score after changing two elements of nums.

 

Example 1:

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

Output: 3

Explanation:

Example 2:

Input: nums = [1,4,3]

Output: 0

Explanation:

 

Constraints: