TLE FOR BIGGER NUMBERS;
TLE for bigger values
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.