"#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
int target;
cin>>target;
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++){
for(int k=j+1;k<n;k++){
if(arr[i]+arr[j]+arr[k] == target)
cout<<arr[i]<<","<<arr[j]<<" and "<<arr[k]<<"\n";
}
}
}
}"
The above is my code for the Arrays-Target Sum Triplets. It was not passing the private the test cases but when I opened the editorial it is showing the same code. What is the error??? Please look into it.