#K12606. Character Frequency Count
Character Frequency Count
Character Frequency Count
Given a string S, your task is to count the frequency of each character in S, excluding space characters. For each character \(c\) in S, compute its frequency according to the formula:
\(count(c) = \sum_{i=1}^{n} [S_i = c]\)
Print each unique character (in the order of its first appearance) and its frequency on a separate line. Each line should contain the character, followed by a single space, and then its frequency.
inputFormat
The input consists of a single line containing the string S.
outputFormat
For each unique character (excluding spaces) in the order of their first appearance in S, output a line containing the character, a space, and its frequency.
## samplehello world
h 1
e 1
l 3
o 2
w 1
r 1
d 1
</p>