Function to find minimum swaps .
function findMinimumSwaps ( arr , n , k ) { let pos , num_min , num_max , need_minimum , need_maximum , swaps ; num_min = num_max = need_minimum = 0 ; need_maximum = swaps = 0 ;