Domanda di colloquio di Myntra

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

Risposta di colloquio

Anonimo

11 mag 2017

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