one test case didnt pass why ?
is the order important,if yes than tell me the changes in my code
#include<bits/stdc++.h>
using namespace std;
void find3Numbers(int arr[],int n,int sum)
{
for(int i=0;i<n-2;i++)
{
//fix the first element of the array
unordered_sets;
int pair_sum=sum-arr[i];
//now we try to find the pair from i+1 to n with sum
//equals to pair
for(int j=i+1;j<n;j++)
{
if(s.find(pair_sum-arr[j])!=s.end())
{
cout<<arr[i]<<", “<<arr[j]<<” and "<<pair_sum-arr[j]<<endl;
}
s.insert(arr[j]);
//if not found than save this value of a[j]
}
}
}
int main()
{
int n;
cin>>n;
int *arr=new int[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int sum;
cin>>sum;
find3Numbers(arr,n,sum);
return 0;
}