int main() {
int T, N;
std::cin>>T;
while(T>0){
int a[N];
std::cin>>N;
for(int i=0; i<N; i++){
std::cin>>a[i];
}
std::next_permutation(a,a+N);
for(int i=0; i<N; i++){
std::cout<<a[i]<<" ";
}
T=T-1;
if(T>0){
std::cout<<std::endl;
}
}
return 0;
}
Here is my code, where I am missing. Plz help. Thanks