Favourite footballer
Time Limit: 1.0 s
Memory Limit: 128.0 MB
Description
Alice got a string S as a gift of new year from his friend Bob. As Alice is so much addicted in football so he was trying to figure out if there has a subsequence in the string S same as his favourite footballers name.
A string SS whill be called a subsequence of string S if it is possible to obtain the string SS by deleting some (possibly zero) characters from S.
for example: alice is a subsequence of uaeloicdoet, if we delete the characters of position \(1,3,5,8,9,11\) the remaining characters are alice
Note: you can not rearrange the string or the subsequence
As a programmer friend of alice can you write a program that can find the answer of this problem?
Input
first line of input consist an integer T: the number of testcases
each test case consists two string of lower case latin letters : S,N: the string alice got and the name of his favourite player.
\(1 <= T <= 100\)
\(2 <= |N| < |S| <= 1000\)
Output
Output T lines, each line should print a string YES if there is a valid subsequence in the string S or NO otherwise.
Sample
Input | Output |
---|---|
|
|
in the first testcase the subsequence is shown by uppercase letters: aaMaESeSmI
in the second and third testcase there has no valid subsequence which can make the string "ronaldo"
Information
- ID
- 1020
- Difficulty
- 5
- Category
- (None)
- Tags
- (None)
- # Submissions
- 19
- Accepted
- 12
- Accepted Ratio
- 63%
- Uploaded By
Related
In following contests: