An array is continuous if all its elements are distinct and the difference between the maximum and minimum equals n-1 (so the values form a run of consecutive integers). In one operation you may replace any element with any integer. Return the minimum operations to make the array continuous. Input: an array of integers.
Input: An array of integers.
Output: Integer — the minimum operations.
Input: [4,2,5,3]
Output: 0
Explanation: Already continuous.Input: [1,2,3,5,6]
Output: 1
Explanation: Replace one element.Input: [1,10,100,1000]
Output: 3
Explanation: Keep one, replace three.1<=n<=10^51<=value<=10^9