-
-
Save ssartell/c0765e7d2be616badb1b33fd68d84078 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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