Skip to content

Instantly share code, notes, and snippets.

@vitorizkiimanda
Created March 20, 2018 03:35
Show Gist options
  • Save vitorizkiimanda/147cde3302a34e7619bf2d632f3e873e to your computer and use it in GitHub Desktop.
Save vitorizkiimanda/147cde3302a34e7619bf2d632f3e873e to your computer and use it in GitHub Desktop.
#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