Chronus Interview Question

Next lexicographic string with same charcters