Retired

Mode Count (retired)

Description:

In statistic is known the term mode. The mode of a set of data values is the value that appears most often. For example suppose the set of data values are {1,2,2,3}. There are three number inside the data set: 1, 2, and 3. Number 1 appears once, 2 appears twice, and 3 appears once. That mean number 2 appears most often so the mode is 2.

Sometime we can find that the most often more than one number here the example

Data set    = {2,2,2,3,3,3,4,5,6}
Mode result = {2,3}

In this Kata, your task is to make a function called int modeCount(int[] data) that the parameter is an array of integer and the result is integer. The parameter is a set of data values that you will find the mode. The output is how many kind of mode. Here the example:

Data set    = {2,2,2,3,3,3,4,5,6}
Mode result = {2,3}
mode Count  = 2

Data set    = {1,2,2,3}
Mode result = {2}
Mode Count  = 1

Data set    = {2,2,2,3,3,3,4,5,6,6,6}
Mode result = {2,3,6}
Mode Count  = 3
Statistics
Algorithms

Stats:

CreatedOct 9, 2019
Warriors Trained155
Total Skips35
Total Code Submissions340
Total Times Completed56
Java Completions56
Total Stars0
% of votes with a positive feedback rating74% of 34
Total "Very Satisfied" Votes20
Total "Somewhat Satisfied" Votes10
Total "Not Satisfied" Votes4
Total Rank Assessments36
Average Assessed Rank
7 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • masudin Avatar
  • ParanoidUser Avatar
Ad