You are given an integer array nums. In one operation, you can replace any element in nums with any other integer.
The array nums is considered continuous if both of the following conditions are satisfied:
All elements in nums are unique.
The difference between the maximum element and the minimum element in nums equals nums.length
Return the minimum number of operations required to make nums continuous.
Constraints:
nums.length
nums[i]
You are given an integer array nums. In one operation, you can replace any element in nums with any other integer.
The array nums is considered continuous if both of the following conditions are satisfied:
All elements in nums are unique.
The difference between the maximum element and the minimum element in nums equals nums.length
Return the minimum number of operations required to make nums continuous.
Constraints:
nums.length
nums[i]