MATL, 16 bytes
t&=?1h}t2#X<wQw(
Try it online! Or verify all test cases
###How it works
How it works
t % Take input implicitly. Duplicate
&= % Matrix of all pairwise equality comparisons
? % If all comparisons were true
1h % Append 1 to the original copy ofthe array
} % Else
t % Duplicate array
2#X< % Push minimum and index of its first occurrence
wQw % Swap, increment, swap (adds 1 to the minimum)
( % Assign the incremented minimum to that position
% End if implicitly. Display implicitly