#C14625. Character Frequency Counter

    ID: 44295 Type: Default 1000ms 256MiB

Character Frequency Counter

Character Frequency Counter

Given a string, count the frequency of each unique character while ignoring spaces. The procedure is case-sensitive, which means that 'a' and 'A' are considered different characters. The output should be a dictionary in the following format:

char1:count1,char2:count2,{ 'char1': count1, 'char2': count2, \dots }

For example, if the input is Hello World, the expected output is:

{'H': 1, 'e': 1, 'l': 3, 'o': 2, 'W': 1, 'r': 1, 'd': 1}

inputFormat

The input consists of a single line containing the string to be processed. The string may include spaces and any printable characters.

outputFormat

Print the dictionary representation of character frequencies (excluding spaces) to standard output. The dictionary should be formatted with single quotes for characters and entries separated by comma and a space.## sample

Hello World
{'H': 1, 'e': 1, 'l': 3, 'o': 2, 'W': 1, 'r': 1, 'd': 1}