Sir In this question they are asking for the next permutation only and What is the problem in mine one?
Not Understand the Problem
@aryangrover
hello aryan,
your code is correct u need just two modifications.
a) add this line in ur code using namespace std;
b) there is space between two integer in output but u r not printing any space so print space after printing each integer.
Ohk Sir that I will but no test case is passing. What can I do in that case?
@aryangrover
check input format.
u are given t test cases. for each test case u need to read n and n integers and output ur answer correspondingly.

Ok Thnx Sir ab kuch smjh aaya krke btata hu
Sir It is again showing errors. Please tell
@aryangrover
hello aryan,
ur code is correct .one small mistake is that return 0 (in line 24) should out of the loop.
Thanks a lot Sir. It worked
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
