ValueMomentum services sometimes transform compact integer buffers in place to reduce temporary allocations. Implement a function that swaps the integers at two positions without using an extra variable, tuple unpacking, or creating another array.
Use the XOR-swap technique. The input list must be modified directly, and the function must return the same list object.
Given an integer list values and valid indices i and j, swap values[i] and values[j] in place. Return values. All list elements are integers, and i and j may refer to the same position.
def swap_without_temp(values, i, j):