Character Frequency
Easyjavapythonccppjavascript
Given a string, count how many times each character occurs and report the counts in order of the characters' first appearance.
Input Format
A single line containing the string S. S has no spaces.
Output Format
For each distinct character, in order of first appearance, print a line c = k where c is the character and k is its number of occurrences.
Example 1
Input
banana
Output
b = 1 a = 3 n = 2
Explanation: a appears three times, n twice, b once — listed in first-appearance order.
- 1 <= length of S <= 100000
- S consists of lowercase English letters and digits, with no spaces.