Skip to content
CampusEduX

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.

Related Problems

  • Reverse a String
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Check Palindrome
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Count Vowels and Consonants
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...