Skip to content

Instantly share code, notes, and snippets.

@ssartell

ssartell/3.cs Secret

Created July 11, 2016 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssartell/c0765e7d2be616badb1b33fd68d84078 to your computer and use it in GitHub Desktop.
Save ssartell/c0765e7d2be616badb1b33fd68d84078 to your computer and use it in GitHub Desktop.
/* LINQ Puzzle #3 *******************************************************
Summary: Given a collection of integers, find the mode. The mode is the value(s) that appears most often in the collection. If multiple values appear equally as often, return all values.
Sample Input: {4, 3, 6, 8, 2, 3}
Sample Output: {3}
Sample Input: {4, 3, 6, 8, 2, 3, 4}
Sample Output: {3, 4}
************************************************************************/
// Given:
var rand = new Random();
var input = Enumerable.Repeat(0, 100).Select(x => rand.Next(0, 30)).ToList();
// Your solution goes here:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment