#K1026. Word Frequency
Word Frequency
Word Frequency
Given a sentence, your task is to compute the frequency of each word. The program must be case-insensitive and ignore any punctuation. After processing the sentence, output each unique word along with its frequency, with the words printed in alphabetical order.
Example:
Input: Hello, hello! How are you? You look great. Output: are 1 great 1 hello 2 how 1 look 1 you 2
Note: Words are separated by whitespace after punctuation is removed and they are converted to lowercase.
inputFormat
The input consists of a single line containing the sentence.
outputFormat
For each unique word, print a line containing the word and its frequency separated by a space. The output should be sorted in alphabetical order by the word.
## sampleHello, hello! How are you? You look great.
are 1
great 1
hello 2
how 1
look 1
you 2
</p>