Microsoft Interview Question

Next Permutation to find the next greatest number (string form)