Meta interview question

next permutation in a string