Skip to content

omahacodeschool/ruby-toy__most-frequent-integer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby Toy

Find the most frequent integer

Given an array of integers (positive, negative, or 0), find the integer that occurs most frequently in that array (you might remember this as the mode from your middle school math class). The set of numbers won't necessarily be in order. If there is more than one number that appears most frequently, your algorithm should return nil.

Here are some examples:

  • [1, 2, 1, 1,] should return 1
  • [1, 2, 3, 4] should return nil
  • [1, 1, 2, 3, 3] should return nil

About

Find the most frequent integer in an array

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published