My one test case is not passing

hey @Insitium, your code is giving wrong output for following testcase:
9
5
7
9
1
2
4
6
8
3
10
correct Output
1, 2 and 7
1, 3 and 6
1, 4 and 5
2, 3 and 5
your output
1, 4 and 5
2, 3 and 5
1, 2 and 7
1, 3 and 6

only order is coming out wrong, so you need to sort the array after outermost for loop.
Consider this
for(int i=0;i<N;i++)
{
for(int j=i+1;j<N;j++)
{ sort(arr,arr+N);
for(int k=j+1;k<N;k++)
{
if(arr[i]+arr[j]+arr[k]==target)
{
cout<<arr[i]<<", “<<arr[j]<<” and "<<arr[k]<<endl;
}
}
}
}

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.