Chef invented a modified wordle.
There is a hidden word and a guess word , both of length .
Chef defines a string to determine the correctness of the guess word. For the index:
- If the guess at the index is correct, the character of is .
- If the guess at the index is wrong, the character of is .
Given the hidden word and guess , determine string .
Input Format
- First line will contain , number of test cases. Then the test cases follow.
- Each test case contains of two lines of input.
- First line contains the string - the hidden word.
- Second line contains the string - the guess word.
Output Format
For each test case, print the value of string .
You may print each character of the string in uppercase or lowercase (for example, the strings , , and will all be treated as identical).
Constraints
- contain uppercase english alphabets only.
Sample Input 1
3
ABCDE
EDCBA
ROUND
RINGS
START
STUNT
Sample Output 1
BBGBB
GBBBB
GGBBG
Explanation
Test Case : Given string and . The string is:
- Comparing the first indices, , thus, .
- Comparing the second indices, , thus, .
- Comparing the third indices, , thus, .
- Comparing the fourth indices, , thus, .
- Comparing the fifth indices, , thus, .
Thus, .
Test Case : Given string and . The string is:
- Comparing the first indices, , thus, .
- Comparing the second indices, , thus, .
- Comparing the third indices, , thus, .
- Comparing the fourth indices, , thus, .
- Comparing the fifth indices, , thus, .
Thus, .
No comments:
Post a Comment