text: Function returns the minimum number of swaps required to sort the array This method is taken from below post https : www . geeksforgeeks . org / minimum - number - swaps - required - sort - array /
code: def minSwapsToSort ( arr , n ) : NEW_LINE