| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 103 | 42 | 30 | 42.857% |
You are given two strings $s$ and $t$. In one operation, you can delete all the odd-indexed characters from $s$ or all the even-indexed characters from $s$.
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 $s$ (including zero), is it possible for $s$ to equal $t$?
The first line of the input contains a single integer $t$ ($1 \le t \le 10^4$) --- the number of test cases. The description of the test cases follows.
The first line of each test case contains a string $s$ ($1 \le |s| \le 2\cdot 10^5$) of lowercase letters --- the starting string, as described above.
The second line of each test case contains a string $t$ ($1 \le |t| \le 2\cdot 10^5$) of lowercase letters --- the desired ending string, as described above.
It is guaranteed that the sum of $|s|$ over all test cases does not exceed $2\cdot 10^5$. Similarly, the sum of $|t|$ over all test cases does not exceed $2\cdot 10^5$.
For each test case, print "YES" if it is possible to make all $s$ equal to $t$ 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.
6 tjhdoumraise thomas nick james baccba baccba abcdefg cde abcdabcd aa abcdabcd bc
YES NO YES NO YES NO
In the first test case, by removing all even-indexed characters of $s$, we obtain $s = thomas$, so we have $s = t$.
In the second test case, the length of $s$ is less than the length of $t$, and if we perform any operations, the length of $s$ will only decrease. Therefore, $s$ can never equal $t$.
In the third test case, we have $s = t$ even before performing any operations.