Amazon interview question

Count minimum swaps with a given array