All submissions for this problem are available.
Do you like Treasure Hunts? I like treasure hunts. Love ‘em. And TROIKA 2013 has the best one ever in ‘MIST’ (apps.facebook.com/mist_troika).
Just like a normal treasure hunt, you are given several clues and you have to get the right answer to progress to the next level and so on, until you reach the ultimate prize! But the organizers have learnt that a lot of users are not progressing even after figuring out the correct answer; it seems ‘someone’ forgot to code in ‘possible variants of the correct answer’ for each level. For example, if “Sachin Tendulkar” happened to be the answer to a particular level, “Tendulkar” or “tendulkar” or “sachin tendulkar” wasn’t accepted as correct. This is what you have to rectify.
Given the expected answer ‘S’, your job is to modify the answer-verification-system to be able to allow acceptable variants of ‘S’.
If the user enters an acceptable variant ,terminate the program. You can assume that the user is intelligent enough so that he will enter the answer in an order specified by the string S i.e he will not enter anything like “Tendulkar Sachin” if the answer is “Sachin Tendulkar” however he can enter “Tendulkar”.
The first line of the input contains a string S.
The next few lines contain the input string P entered by the user.
For every line entered by the user output “Yes” if the string is acceptable and “No” if it is not. (quotes only for clarity).
1 <= length of S and P <= 10000
Input 1: Sachin Ramesh Tendulkar Sach Ram sAcH Tendul sach Tendulkar Sachin Ram Tendulkar SAChin TENduLkaR Output 1: No No No No No Yes Input 2: Sachin Ramesh Tendulkar Sach Ram sAcH Tendul sach Tendulkar Sachin Ram Tendulkar Ramesh TENduLkaR Output 2: No No No No No Yes
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, 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, CLOJ, FS|
Fetching successful submissions