There are a number of genes in a chromosome and your bioinformatic friend wants to check if a particular chromosome has a series of genes or not.
The sequence in which genes occur is important. You want to help your friend in this matter.
He gives you n chromosomes and a series of genes he wants to check. Help him identify whether these genes are present in the
chromosome in the given order.
Because you are not a biology student, he’s made things easier for you. He represents genes by a letter, number or special character present in ASCII.
Spaces do NOT represent a gene.
If the chromosome is abdfgc, and the genes he’s querying for is abc, these are present (in the correct order) in the chromosome (marked in bold).
abdfgc. However if the query is bca, this is not present in the correct order in the chromosome.
The first line of input consists of an integer n which is the number of test cases.
Each test case consists of two lines of input:
The first line contains the chromosome
The second line contains the gene you are querying for
The output for that chromosome-gene pair should be “YES” if the genes, taken in order, are contained in the chromosome and “NO” otherwise.
The output should have n lines containing YES/NO.
1 <= n <= 10000
1 <= |chromosome| <100
1 <= |gene| < |chromosome|