How would you compute the minimum swaps required to sort an array?
Implement min_swaps_to_sort(nums), where nums contains distinct integers. Return the minimum number of swaps between any two positions needed to arrange the array in ascending order. The function may modify nums.
Input is a list of integers, and output is an integer. Assume the input is valid and contains at least one element.
def min_swaps_to_sort(nums):