im getting run error for all the test cases except the first one in this question . Here’s the code
#include
#include
using namespace std;
int main() {
int arr[10],n,m;
cin>>n;
for(int i=0;i<n;i++ )
{
cin>> m;
for(int i = 0;i<m;i++)
{
cin>>arr[i];
}
next_permutation(arr,arr+m);
for(int i =0 ; i<m ; i++)
{
cout<<arr[i]<<" ";
}
cout<<endl;
}
return 0;
}