Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Drawing;
- using System.Text;
- namespace ClassWork
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- foreach (var line in ThirdTask(new[] {"abc", "bgf", "aab", "Ffg", "fdgOkM"}))
- {
- Console.WriteLine(line);
- }
- }
- public static string[] ThirdTask(string[] lines)
- {
- var letterCounter = lines
- .Select(line => line.ToLower().ToCharArray()
- .GroupBy(symb => symb)
- .Select(group => Tuple.Create(group.Key, group.Count())))
- .Where(dict => dict.All(x => x.Item2 == 1));
- return letterCounter
- .Select(tuple =>
- {
- var str = new StringBuilder();
- foreach (var x in tuple) str.Append(x.Item1);
- return str.ToString();
- })
- .ToArray();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement