I have removed several errors, but now I am unable to understand what has gone wrong, please help me in debugging the code in COLLABORATIVE mode.
/////////////////My Code///////////
#include
#include
#include
using namespace std;
int main() {
int T;
cin>>T;
while(T>0){
vector v;
int size, number;
cin>>size;
for(int i=0;i<size;i++){
cin>>v.push_back(number);
}
auto np = next_permutation(v.begin(),v.end());
if(np!=0){
for(int x:np){
cout<<x<<" “;
}
}
else{
sort(v.begin(),v.end());
for(int x:v){
cout<<x<<” ";
}
}
T–;
}
return 0;
}
////////////////////////////////////////