BSF Sponsorship Help
All submissions for this problem are available.
BITS Sports Festival was bigger than ever. But as it got bigger, so did the list of sponsors. There were so many sponsors trying to sponsor BITS Sports Festival this year, that the BSF team had to decide which sponsor to choose and which one to not.
Brijesh came up with a unique scheme to help the team decide. He made his own font to write the names of the sponsors , but he forgot to make some alphabets. So to decide whether to choose a sponsor or drop it, he saw if he could write the whole name of the sponsor from the font he made.
Note: He can only wrote the name of sponsor if all the alphabets the name used could be written by the new font. Also the name may contain spaces which must be ignored. For simplicity all sponsor names will be in lowercase only.
Now you were a part of the BSF Sponsorship Team and it was your job to tell your team whether they needed to choose a given sponsor or not. Also if a given sponsor was chosen, you need to print “yes” and you need to mention the alphabets that were there in the new font but not used in the name in alphabetical order in lowercase. And if the given sponsor was dropped then you need to print “no”.
First line contains single integer n denoting no. of testcases.
For each testcase first line contains integer m denoting the number of available sponsors.
Next line contains a string of alphabets which denotes the alphabets which can't be written by the new font in lowercase without space.
Next m lines contain a string of length l characters.
For each test case,you need to print whether a given sponsor is chosen or dropped i.e. the output will contain m (no of available sponsor for that test case) lines in format of
(1) "Yes" + one space + string containing all alphabets from the new font not used in write the name of this sponsor without space in lowercase in alphabetical order(a,b,c...z).
Input: 1 2 xyz ieee daiict abcx Output: Yes bfghjklmnopqrsuvw No
First name can be written without using bfghjklmnopqrsuvw alphabets
Second name can't be written since there is 'x' which s not in our new font.
|Time Limit:||10 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.