Created
March 20, 2018 03:35
-
-
Save vitorizkiimanda/147cde3302a34e7619bf2d632f3e873e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
string input1,input2; | |
vector<char> result; | |
cin>>input1>>input2; | |
for(int i=0;i<input1.length();i++){ | |
bool found=false; | |
for(int j=0 ; j<input2.length();j++){ | |
if(input1[i]==input2[j]) found = true; | |
} | |
if(!found) result.push_back(input1[i]); | |
} | |
for(int i=0;i<input2.length();i++){ | |
bool found=false; | |
for(int j=0 ; j<input1.length();j++){ | |
if(input2[i]==input1[j]) found = true; | |
} | |
if(!found) result.push_back(input2[i]); | |
} | |
for(int i=0;i<result.size();i++){ | |
cout << result[i]; | |
if(i==result.size()-1) cout<<endl; | |
else cout <<','; | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment