I had code in C++ which works really. I need to find alternative solution for this kind of solution... Could some help me how to change the code ...
#include <string>
#include <iostream>
using namespace std;
int main(){
string s1="abv"; //Set up string 1
string s2="vxz"; //Set up string 2
string s3; //Setup string 3
cout<<"First string: "<<s1<<endl;
cout<<"Second string: "<<s2<<endl;
s3=s1; //Copy string 1 into string 3
for(int i=0;i<s2.size();i++){ //Loop through s2
char c=s2[i]; //Grab current character from s2
bool is_c_in_s3=false;
for(int j=0;j<s3.size();j++){ //Loop though s3
if (c == s3[j]) {
is_c_in_s3=true;
break;
}
}
if(!is_c_in_s3){
s3=s3+c; //Add to String 3
}
}
cout<<"Final string: "<<s3<<endl;
}