Meta Interview Question

Asked the next permutation problem.