Return the minimum number of swaps required to sort the array
function minSwaps ( arr , N ) { let ans = 0 ; let temp = [ ... arr ] ; temp . sort ( function ( a , b ) { return a - b ; } ) ; for ( let i = 0 ; i < N ; i ++ ) {