Microsoft interview question

Next Permutation in an array