##
Minimum swaps to reach permuted array with at most 2 positions left swaps allowed
March 26, 2017

Given a permuted array of length N of first N natural numbers, we need to tell the minimum number of swaps required in the sorted array of first N natural number to reach given permuted array where a number can be swapped with at most 2 positions left to it. If it is not possible… Read More »