#C3990. Letter Frequency Count
Letter Frequency Count
Letter Frequency Count
Given a string, count the frequency of each character and output them in the order they first appear in the string. For each unique character, append the number of times it occurs. The counts for each character should be separated by a single space.
For example, if the input is hello
, then the output should be h1 e1 l2 o1
because 'h' appears once, 'e' appears once, 'l' appears twice, and 'o' appears once.
Note: Input will be read from standard input (stdin) and the result must be printed to standard output (stdout).
inputFormat
A single line string consisting of characters. The string will be provided via standard input (stdin).
outputFormat
A single line string where each unique character from the input is concatenated with its frequency count. Each character-count pair is separated by a single space. The output must be written to standard output (stdout).## sample
hello
h1 e1 l2 o1