#C14382. Letter Frequency Count

    ID: 44025 Type: Default 1000ms 256MiB

Letter Frequency Count

Letter Frequency Count

You are given a string. Your task is to count the frequency of each alphabetical letter in the string, regardless of case, and ignore any non-alphabetical characters. All letters should be treated in a case-insensitive manner (i.e. 'A' and 'a' are considered the same) and your output should list the frequency of each letter that appears in the string.

Note: The output should be presented as a JSON object (dictionary) with the keys sorted in alphabetical order. The keys are lowercase letters and the values are their respective counts. For example, if the input string is The quick brown fox jumps over the lazy dog!, the output should be

\( {\text{"a"}:1,\text{"b"}:1,\text{"c"}:1,\text{"d"}:1,\text{"e"}:3,\text{"f"}:1,\text{"g"}:1,\text{"h"}:2,\text{"i"}:1,\text{"j"}:1,\text{"k"}:1,\text{"l"}:1,\text{"m"}:1,\text{"n"}:1,\text{"o"}:4,\text{"p"}:1,\text{"q"}:1,\text{"r"}:2,\text{"s"}:1,\text{"t"}:2,\text{"u"}:2,\text{"v"}:1,\text{"w"}:1,\text{"x"}:1,\text{"y"}:1,\text{"z"}:1 } \)

inputFormat

The input is given via standard input (stdin) as a single string. This string may contain spaces, punctuation, numbers, and other non-alphabetical characters.

outputFormat

Print to standard output (stdout) a JSON object (dictionary) that maps each lowercase alphabetical letter found in the input string to its frequency count. The keys of the dictionary must be sorted in alphabetical order. Use the JSON format without extra spaces (e.g. {"a":1,"b":2}).

## sample
The quick brown fox jumps over the lazy dog!
{"a":1,"b":1,"c":1,"d":1,"e":3,"f":1,"g":1,"h":2,"i":1,"j":1,"k":1,"l":1,"m":1,"n":1,"o":4,"p":1,"q":1,"r":2,"s":1,"t":2,"u":2,"v":1,"w":1,"x":1,"y":1,"z":1}