Intuitive Elements
Time limit1sMemory limit2048 MB
Given two lowercase strings, the task checks whether every letter in the abbreviation b also appears somewhere in the name a, printing YES or NO for each test case.
Problem
Brandon is learning the periodic table! However, he doesn't like some of the elements because the symbol of the element contains letters which are not present in the name of the element. He finds this to be unintuitive, especially because in other contexts, he expects abbreviations to not introduce random letters.
Given a string and a proposed abbreviation, determine if Brandon would find it intuitive. Brandon finds an abbreviation intuitive if and only if every letter that appears in the abbreviation appears in the original string. Brandon does not look at the abbreviation carefully, so it is acceptable for a letter to appear more times in the abbreviation than in the original string, or for the letters to appear in a different order between the string and the abbreviation.
Input
The first line contains a single integer (), the number of test cases. Each test case has two lines. The first line contains a string of length at least 2 and at most 50, consisting only of lowercase letters. The second line contains a string that is strictly shorter than , also consisting only of lowercase letters.
Output
For each test case, output YES if every letter in appears in , and NO otherwise. Print one answer per line.