3224. Minimum Array Changes to Make Differences Equal
You are given an integer array
numsof sizenwherenis 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
0tok.You need to perform some changes (possibly none) such that the final array satisfies the following condition:
- There exists an integer
Xsuch thatabs(a[i] - a[n - i - 1]) = Xfor all(0 <= i < n).Return the minimum number of changes required to satisfy the above condition.
1 |
|