Microsoft Interview Question

Next Permutation in an array