Skip to content
CampusEduX

Frequency Map

Easyjavapythonccppjavascript

Given an integer array, count how many times each distinct value occurs and report the counts in order of the values' first appearance.

Input Format

The first line contains an integer N. The second line contains N space-separated integers.

Output Format

For each distinct value, in order of first appearance, print a line v = k where v is the value and k is its count.

Related Problems

  • Find Duplicate Values
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Common Elements in Three Arrays
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Pair with Given Difference
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...