Remove common characters and concatenate
Submissions: 14210   Accuracy:

32.3%

  Difficulty: Basic   Marks: 1
     

Two strings are given. Modify 1st string such that all the common characters of the 2nd strings have to be removed and the uncommon characters of the 2nd string have to be concatenated with uncommon characters of the 1st string.

Note: If the modified string is empty then print '-1'.

Input:
The first line consists of an integer T i.e number of test cases. The first line of each test case consists of a string s1.The next line consists of a string s2

Output:
Print the required output.

Constraints: 
1<=T<=200
1<=|Length of Strings|<=100

Example:
Input:

2
aacdb
gafd
abcs
cxzca

Output:
cbgf
bsxz

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: deactjustGautam


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.