You are viewing a single comment's thread. Return to all comments →
For starters i was going with dictionary, but your solution gave me an idea.
static int migratoryBirds(int n, int[] ar) { return ar .GroupBy(x => x) .Aggregate((x, y) => x.Count() > y.Count() ? x : y) .Key; }
I love the grouping part.
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
For starters i was going with dictionary, but your solution gave me an idea.
I love the grouping part.