#C13983. Character Frequency Analysis
Character Frequency Analysis
Character Frequency Analysis
Given a string, your task is to analyze the frequency of each character, ignoring the case (i.e. 'A' and 'a' are considered the same).
You should count every character including spaces and special characters. For example, the frequency of character \(c\) in a string \(s\) is defined as
\(\text{freq}(c) = \#\{i \mid s_i = c\}\).
Output each unique character and its corresponding count on a separate line, sorted in ascending order by their ASCII values.
inputFormat
Input is a single line string which may consist of letters, digits, spaces, and special characters. The string can be empty.
outputFormat
For each unique character in the string (after converting the entire string to lower-case), output a line in the format "character: frequency". The output should be sorted in ascending order according to the ASCII value of the characters. If the input string is empty, print nothing.## sample
Apple
a: 1
e: 1
l: 1
p: 2
</p>