- Prepare
- Interview Preparation Kit
- Abbreviation
Abbreviation
Abbreviation
You can perform the following operations on the string, :
- Capitalize zero or more of 's lowercase letters.
- Delete all of the remaining lowercase letters in .
Given two strings, and , determine if it's possible to make equal to as described. If so, print YES
on a new line. Otherwise, print NO
.
For example, given and , in we can convert and delete to match . If and , matching is not possible because letters may only be capitalized or discarded, not changed.
Function Description
Complete the function in the editor below. It must return either or .
abbreviation has the following parameter(s):
- a: the string to modify
- b: the string to match
Input Format
The first line contains a single integer , the number of queries.
Each of the next pairs of lines is as follows:
- The first line of each query contains a single string, .
- The second line of each query contains a single string, .
Constraints
- String consists only of uppercase and lowercase English letters, ascii[A-Za-z].
- String consists only of uppercase English letters, ascii[A-Z].
Output Format
For each query, print YES
on a new line if it's possible to make string equal to string . Otherwise, print NO
.
Sample Input
1
daBcd
ABC
Sample Output
YES
Explanation
We have daBcd
and ABC
. We perform the following operation:
- Capitalize the letters
a
andc
in so thatdABCd
. - Delete all the remaining lowercase letters in so that
ABC
.
Because we were able to successfully convert to , we print YES
on a new line.