Infosys Interview Question

3.) Coding Question to find the next permutation of a given number