MLP interview question

Compute the permutation of an array