Driver code
public static void main ( String [ ] args ) { int arr [ ] = { 2 , 1 , 5 , 6 , 3 } ; int n = arr . length ; int k = 3 ; System . out . print ( minSwap ( arr , n , k ) + "NEW_LINE"); int arr1 [ ] = { 2 , 7 , 9 , 5 , 8 , 7 , 4 } ; n = arr1 . length ; k = 5 ; System . out . print ( minSwap ( arr1 , n , k ) ) ; } }