#K16211. Character Frequency Counter
Character Frequency Counter
Character Frequency Counter
You are given a string s consisting of lowercase English letters. Your task is to count the frequency of each character in the string and output the results as pairs, with the characters sorted in alphabetical order.
For instance, if the input is "hello", the output should be:
e 1 h 1 l 2 o 1
If the input string is empty, no output should be produced.
Note: The output should be printed to the standard output (stdout) and the input will be provided via standard input (stdin). Each output line must contain a character and its frequency separated by a single space.
inputFormat
The input consists of a single line containing a string s of lowercase English letters. The string may be empty.
outputFormat
Output the frequency of each letter present in the input string. Each line of the output should contain a letter and its corresponding frequency, separated by a single space. The letters must appear in alphabetical order. If the input string is empty, do not output anything.
## samplehello
e 1
h 1
l 2
o 1
</p>