6 kyu

Highest Rank Number in an Array

6,578 of 17,727KK20994

Description:

Complete the method which returns the number which is most frequent in the given input array. If there is a tie for most frequent number, return the largest number among them.

Note: no empty arrays will be given.

Examples

[12, 10, 8, 12, 7, 6, 4, 10, 12]              -->  12
[12, 10, 8, 12, 7, 6, 4, 10, 12, 10]          -->  12
[12, 10, 8, 8, 3, 3, 3, 3, 2, 4, 10, 12, 10]  -->   3
Arrays
Fundamentals

More By Author:

Check out these other kata created by KK20994

Stats:

CreatedSep 23, 2014
PublishedSep 23, 2014
Warriors Trained29417
Total Skips2783
Total Code Submissions97990
Total Times Completed17727
JavaScript Completions7371
Haskell Completions585
Clojure Completions458
C# Completions1167
Python Completions6578
F# Completions100
Go Completions1114
Ruby Completions404
C Completions232
Groovy Completions13
Total Stars448
% of votes with a positive feedback rating92% of 1930
Total "Very Satisfied" Votes1668
Total "Somewhat Satisfied" Votes234
Total "Not Satisfied" Votes28
Ad
Contributors
  • KK20994 Avatar
  • jhoffner Avatar
  • xcthulhu Avatar
  • guumaster Avatar
  • surtich Avatar
  • Unnamed Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • user5036852 Avatar
  • hobovsky Avatar
  • testfirstcoder Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
  • MikChan Avatar
  • FranzMartyn Avatar
  • cwps Avatar
  • saudiGuy Avatar
Ad