Frequency of Each Element Problem

Frequency of Each Element Problem — ExecCode School DSA Practice

Solve the Frequency of Each Element problem on ExecCode. Free online school DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You are given a whole number for the problem Frequency of Each Element. Your task is to solve Frequency of Each Element. Count the occurrences of each unique element in a given list of numbers. Print each element and its count.

Examples

Input 5 1 2 2 3 3; Output 1 -> 1 2 -> 2 3 -> 2. Input 3 1 1 1; Output 1 -> 3

Constraints

1 <= N <= 10^4

Practice Frequency of Each Element free on ExecCode. Browse DSA problems, topic map, and placement guides.