"sum of unique two from given 2 array and do sum of it" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "sum of unique two from given 2 array and do sum of it" answered properly. Developers are finding an appropriate answer about sum of unique two from given 2 array and do sum of it related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like sum of unique two from given 2 array and do sum of it. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on sum of unique two from given 2 array and do sum of it.
sum of unique two from given 2 array and do sum of it
#include<iostream>
#include<map>
#include<vector>
using namespace std;
void unique_array_value_sum(int a[],int b[],int s,int e1,int e2)
{
int sum=0;
vector<int> v;
map<int,int> ar1;
map<int,int> ar2;
for(int x=0;x<e1;x++)
{
ar1[a[x]]++;
}
for(auto i:ar1)
{
if(i.second==1)
{
v.push_back(i.first);
}
}
for(int y=0;y<e2;y++)
{
ar2[b[y]]++;
}
for(auto i:ar2)
{
if(i.second==1)
{
v.push_back(i.first);
}
}
map<int,int> un;
for(int u=0;u<v.size();u++)
un[v[u]]++;
for(auto i:un)
{
if(i.second==1)
{
sum+=i.first;
}
}
cout<<sum;
}
int main()
{
int n1,n2;
cout<<"Enter size of 2 arrays:";
cin>>n1>>n2;
int a[n1],b[n2];
//scanning 1st array
for(int p=0;p<n1;p++)
{
cin>>a[p];
}
//scanning 2nd array
for(int q=0;q<n2;q++)
{
cin>>b[q];
}
sort(a,a+n1);
sort(b,b+n2);
unique_array_value_sum(a,b,0,n1,n2);
return 0;
}
All those coders who are working on the Whatever based application and are stuck on sum of unique two from given 2 array and do sum of it can get a collection of related answers to their query. Programmers need to enter their query on sum of unique two from given 2 array and do sum of it related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about sum of unique two from given 2 array and do sum of it for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of sum of unique two from given 2 array and do sum of it while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "sum of unique two from given 2 array and do sum of it". Visit this developer's friendly online web community, CodeProZone, and get your queries like sum of unique two from given 2 array and do sum of it resolved professionally and stay updated to the latest Whatever updates.