Word Count
Hints
(Try not to use 'em, you
won't get 'em during the real contest.)
A group of linguists wants to communicate securely online without
being monitored by Big Brother. They decide upon the following code:
they will send messages back and forth that are made up of large
amount of English text. To decrypt such a message, the receiver will
count up how many times each word in the message appears (ignoring
case and punctuation). Then the receiver will look through that word
list in alphabetic order, checking the count for each word. If the
count is in the range 1-37, then will output a single character for
that count as follows:
- A: 1, B: 2, ... Z: 26
- Space (" "): 27
- 0: 28, 1: 29, 2: 30 ... 9: 37
For this problem you may assume there is no punctuation in the input.
Also, your output must be followed by a single newline (\n) character.
Sample Input
ape
ape
ape
ape
ape
ape
ape
ape
bat
bat
bat
bat
bat
cat
cat
cat
cat
cat
cat
cat
cat
cat
cat
cat
cat
dog
dog
dog
dog
dog
dog
dog
dog
dog
dog
dog
dog
eel
eel
eel
eel
eel
eel
eel
eel
eel
eel
eel
eel
eel
eel
eel
Sample Output
HELLO