#C13903. Word Frequencies

    ID: 43493 Type: Default 1000ms 256MiB

Word Frequencies

Word Frequencies

You are given a string which may contain letters, punctuation, and extra spaces. Your task is to count the frequency of each word in the string, ignoring all punctuation and case differences. A word is defined as a contiguous sequence of alphanumeric characters. Then, output a JSON object that maps each word to its corresponding frequency. The keys in the JSON object must be sorted in lexicographical order and printed without any extra spaces.

For example, if the input is:

Hello, world! Hello.

Then the output should be:

{"hello":2,"world":1}

inputFormat

The input consists of a single line containing the string to be processed. The string may contain letters, punctuation marks, and extra spaces.

outputFormat

Output a single line containing a JSON object (with keys sorted in lexicographical order and no extra spaces) that maps words to their frequency counts.

## sample
Hello, world! Hello.
{"hello":2,"world":1}