Return the minimum number of swaps required to sort the array
static int minSwaps ( int [ ] arr , int N ) { int ans = 0 ; int [ ] temp = new int [ N ] ; Array . Copy ( arr , temp , N ) ; Array . Sort ( temp ) ; for ( int i = 0 ; i < N ; i ++ ) {