Writer: jjjjj19980806 Description: pclightyear Difficulty: ★★★☆☆
Niflheimr aspires to compete with the top coder around the world in the competitive programming contest. One key factor to win the contest is the typing speed. The faster you can type, the less time penalty you will get. But sometimes fast typing may lead to some typos. After Niflheimr's observation, there are four common types of typos:
(1) Niflheimr accidentally types one more character.
(2) Niflheimr accidentally forgets to type one character.
(3) Niflheimr accidentally types one wrong character.
(4) Niflheimr accidentally switches two different adjacent characters.
Now Niflheimr asks you to design a typo detector. Niflheimr will input two strings s (the correct string) and t (the string Niflheimr types). You design must be able to determine whether t meets one of the four types of typo as above.
If you can help Niflheimr, maybe he will teach you how to design an efficient parallel program.
The first line contains an integer T, representing the number of inputs Niflheimr gives to you.
The next T line contains two strings si, ti, representing the correct string and the string Niflheimr types.
It is guaranteed that:
For each input, if t meets one of the four types of typo, please output "Yes", otherwise please output "No".