Myntra interview question

Write an algorithm to check in in an integer array, the array can be sorted by just one exchange of elements

Interview Answer

Anonymous

11 May 2017

By sorting the array and then seeing the number of elements that are different in the original and the sorted array