All submissions for this problem are available.
You have one main string and some query strings.
You have to output the query strings which have at least k matches with the main string.
The number of matches between a query string and the main string is defined as the number of distinct characters which are present in both of these strings.
If there is no such string:
Print "No" (without the quotes)
Print "Yes" (without the quotes) and then print all the strings (each on a new line) which satisfy the condition, in the order in which they appear in input.
- The first line contains one integer T - the number of test cases
- The first line of each test case contains one word - the main string.
- The second line of each test case contains two integers, N and K.
- The next N lines of each test case contain the query strings.
If no word has at least K matches, output "No" (without the " "). Else, print "Yes" along with list of strings with at least K matches, each in a new line, in order they are given in input.
"aaabbb" and "abc" have more than 2 matches with "abc".
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions