String Split
면접 대비시간 제한1초메모리 제한1024 MB
문자열 s에서 홀수 번째 문자 전체 또는 짝수 번째 문자 전체를 반복해서 지울 수 있을 때, s를 t로 만들 수 있는지 판정한다.
문제
You are given two strings and . In one operation, you can delete all the odd-indexed characters from or all the even-indexed characters from .
For example, if you perform an operation on the string abcdefg, you could choose to turn it into aceg or bdf.
After performing any number of operations on (including zero), is it possible for to equal ?
입력
The first line of the input contains a single integer () --- the number of test cases. The description of the test cases follows.
The first line of each test case contains a string () of lowercase letters --- the starting string, as described above.
The second line of each test case contains a string () of lowercase letters --- the desired ending string, as described above.
It is guaranteed that the sum of over all test cases does not exceed . Similarly, the sum of over all test cases does not exceed .
출력
For each test case, print "YES" if it is possible to make all equal to after any number of operations, and "NO" otherwise.
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.
힌트
In the first test case, by removing all even-indexed characters of , we obtain , so we have .
In the second test case, the length of is less than the length of , and if we perform any operations, the length of will only decrease. Therefore, can never equal .
In the third test case, we have even before performing any operations.