3224. Minimum Array Changes to Make Differences Equal
You are given an integer array
nums
of sizen
wheren
is even, and an integerk
.You can perform some changes on the array, where in one change you can replace any element in the array with any integer in the range from
0
tok
.You need to perform some changes (possibly none) such that the final array satisfies the following condition:
- There exists an integer
X
such thatabs(a[i] - a[n - i - 1]) = X
for all(0 <= i < n)
.Return the minimum number of changes required to satisfy the above condition.
1 |
|