Lonely Integer

  • + 0 comments

    group the numbers find the group that has only one element first .Single gets the IGrouping second .Single gets the int from that Grouping.

    return a.GroupBy(i => i).Where(i => i.Count() ==1).Single().Single();