Maximum Equal Adjacent Pairs After at Most One Replacement
Merging two values makes exactly their adjacent pairs equal. Count neighbour pairs of distinct values and add the largest tally to the existing equal pairs.
Merging two values makes exactly their adjacent pairs equal. Count neighbour pairs of distinct values and add the largest tally to the existing equal pairs.