7 kyu

Find Count of Most Frequent Item in an Array

4,037 of 13,715Fosna

Description:

Complete the function to find the count of the most frequent item of an array. You can assume that input is an array of integers. For an empty array return 0

Example

input array: [3, -1, -1, -1, 2, 3, -1, 3, -1, 2, 4, 9, 3]
ouptut: 5 

The most frequent number in the array is -1 and it occurs 5 times.

Data Structures
Fundamentals

More By Author:

Check out these other kata created by Fosna

Stats:

CreatedNov 27, 2015
PublishedNov 27, 2015
Warriors Trained19965
Total Skips925
Total Code Submissions51104
Total Times Completed13715
JavaScript Completions4037
CoffeeScript Completions20
Ruby Completions1244
Python Completions4728
Haskell Completions211
Java Completions2126
C# Completions402
C++ Completions1650
Scala Completions18
C Completions26
Total Stars208
% of votes with a positive feedback rating91% of 1245
Total "Very Satisfied" Votes1052
Total "Somewhat Satisfied" Votes163
Total "Not Satisfied" Votes30
Ad
Contributors
  • Fosna Avatar
  • joh_pot Avatar
  • CrazyMerlyn Avatar
  • anter69 Avatar
  • gttotev Avatar
  • kazk Avatar
  • Voile Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • hobovsky Avatar
  • Just4FunCoder Avatar
  • 66  Avatar
  • heroicfun Avatar
  • KayleighWasTaken Avatar
Ad