2
def minMoves(self, nums: List[int], limit: int) -> int:4
overlay_arr = [0] * (2 * limit + 2)5
for i in range(n // 2):6
left_boundary = min(nums[i], nums[n - 1 - i]) + 17
no_move_value = nums[i] + nums[n - 1 - i]8
right_boundary = max(nums[i], nums[n - 1 - i]) + limit9
overlay_arr[left_boundary] -= 110
overlay_arr[no_move_value] -= 111
overlay_arr[no_move_value + 1] += 112
overlay_arr[right_boundary + 1] += 113
curr_moves = n # initial assumption of two moves for each pair16
for i in range(2, 2 * limit + 1):17
curr_moves += overlay_arr[i]18
res = min(res, curr_moves)