1.

Difference between highest and least frequencies in an array

Answer»

Answer:

GIVEN an array, find the difference between highest OCCURRENCE and least occurrence of any number in an array

Examples:

Input : arr[] = [7, 8, 4, 5, 4, 1, 1, 7, 7, 2, 5]

OUTPUT : 2

Lowest occurring element (5) occurs once.

Highest occurring element (1 or 7) occurs 3 times

Input : arr[] = [1, 1, 1, 3, 3, 3]

Output : 0

#followme

#markasbrainlist

...



Discussion

No Comment Found