DCEPC207 - Finally a Treat
Anuja ma’am is getting more and more obsessed by her name (actually she loves it!!!). She has a strong belief that her name has something very special but she could not make it out what is it. As Vaibhav sir is very good in finding pattern he helped her with her problem, that she has a name in which only one character has maximum frequency i.e. ‘a’. She became very happy and decided to give a party to all of the members of DCE Coders who have special names. But wait, she finds out that the list is too big, so she decided to narrow it down. Heres how she narrows it: “Anuja ma’am will give a party to all those whose name is special and the character which makes their name special MUST be the character with maximum frequency in the entire list of names. There is only ONE special character in the string.”
As a student you are required to make a list of names ELLIGIBLE for party.
Remember, a name is special only if a SINGLE character has the maximum frequency in it. (See example #2 )
1st line contains T(1<=T<=100), number of test cases. Next T lines contain a string(1<=Length of
String<=10000) containing list of names separated by SPACES.
Output k+1 lines for each test case, where k is the number of students ELLIGIBLE. First line
contains “Case #x:” where x is the case number starting from 1. Then next k lines contain the names
of ELLIGIBLE students.
Note: Each input string will have at least 1 word (of at least 1 character). i.e. there is no input string with only spaces
abcdd abccd cccd
aabb aabcc aaa adaa Output: Case #1:
Had to drop all the convenient Python idioms to pass the TL, but it's a good lesson as a primitive C-like solution gets AC easily.
easy one silly mistake cost's me 2 WA
Some clarifications that should have been part of the problem statement-
Last edit: 2016-05-18 18:21:43
Last edit: 2015-06-21 15:47:34
i think there is some problem with this question.same code is getting wa and got accepted idk why...
shiv prasad chabarval:
WA again and again....please help id:9527295
m gettin WA.... any tricky tst cases...
Vimal Raj Sharma:
all names are made up of small letters ?