Next permutation

Its showing run error.

#include
#include

using namespace std;

int main(){

int arr[100];

int t;
cin>>t;



while(t>0){
    int n;
	cin>>n;
	for(int i = 0; i<n; i++){
		cin>>arr[i];
	}

	next_permutation(arr, arr + n);
	for(int i = 0; i<n; i++){
		cout<<arr[i]<<" ";
	}
	cout<<endl;
	t--;
}
return 0;

}

hey @arjun.12narang
increase array size to 1000

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.