PayPal Interview Question

Find next permutation of a string