You are given an integer array nums.
You are permitted to perform the following operation at most
Select two integers x and y, and replace every element in nums that is equal to x with y.
Return the maximum number of adjacent equal pairs (indices i satisfying nums[i] == nums[i + 1]) that can be obtained after applying at most
Constraints:
nums.length
nums[i]
You are given an integer array nums.
You are permitted to perform the following operation at most
Select two integers x and y, and replace every element in nums that is equal to x with y.
Return the maximum number of adjacent equal pairs (indices i satisfying nums[i] == nums[i + 1]) that can be obtained after applying at most
Constraints:
nums.length
nums[i]