Lonely Integer

  • + 0 comments
        public static int lonelyinteger(List<int> a)
        {
            return a.GroupBy(i => i).Single(g => g.Count() == 1).Key;
        }