Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CodeEval.com
- // Medium - First Non-Repeated Character
- // Score: 56.158
- using System;
- using System.IO;
- using System.Linq;
- using System.Text.RegularExpressions;
- class Program
- {
- static int Main(string[] args)
- {
- using (StreamReader reader = File.OpenText(args[0]))
- {
- while (!reader.EndOfStream)
- {
- var line = reader.ReadLine();
- var result = line.ToCharArray().GroupBy(l => l).Where(l => l.Count() == 1).Select(l => l.Key);
- Console.WriteLine(result.First());
- }
- }
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement