Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace OddOccurrences
- {
- class Program
- {
- public static void Main()
- {
- var oddCounts = Console.ReadLine()
- .ToLower()
- .Split(" ")
- .GroupBy(x => x)
- .ToDictionary(x => x.Key, x => x.Count())
- .Where(x => x.Value % 2 == 1)
- .Select(x => x.Key)
- .ToList();
- Console.WriteLine(string.Join(" ", oddCounts));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement