TLE for bigger values

TLE FOR BIGGER NUMBERS;

code link https://ide.codingblocks.com/s/185382

Hi, in dis question u only need to print the next permutation. In ur code, u r displaying more than one next permutations because of which u might be getting tle .
Hope dis resolves ur doubt.

Corrected Code

and whats the point of the problem, if you use builtin next_permutation(). Try to implement your own function and then proceed with this problem.