Skip to content

Instantly share code, notes, and snippets.

@dance2die

dance2die/Stray1.cs

Created Oct 7, 2017
Embed
What would you like to do?
Sung's implementation
public static int Stray(int[] numbers)
{
return numbers
.GroupBy(n => n)
.Select(g => new { Key = g.Key, Count = g.Count() })
.Where(o => o.Count % 2 == 1).FirstOrDefault().Key;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.