You are given a nums.
The array nums is considered alternating if:
nums[i] is equal to nums[i - 2] for all nums.length
nums[i] is not equal to nums[i - 1] for all nums.length
In one operation, you can choose any index i and change nums[i] to any positive integer.
Return the minimum number of operations required to make nums alternating.
Constraints:
nums.length
nums[i]
You are given a nums.
The array nums is considered alternating if:
nums[i] is equal to nums[i - 2] for all nums.length
nums[i] is not equal to nums[i - 1] for all nums.length
In one operation, you can choose any index i and change nums[i] to any positive integer.
Return the minimum number of operations required to make nums alternating.
Constraints:
nums.length
nums[i]