Skip to content

Instantly share code, notes, and snippets.

@briandiaz
Created June 2, 2014 20:09
Show Gist options
  • Save briandiaz/b7128813acec7c180019 to your computer and use it in GitHub Desktop.
Save briandiaz/b7128813acec7c180019 to your computer and use it in GitHub Desktop.
First Non-Repeated Character at CodeEval.com (https://www.codeeval.com/open_challenges/12/)
/*
Author: Brian Díaz
*/
using System;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections.Generic;
class Program
{
public static void Main(String[] args)
{
string Line = "";
string[] words;
System.IO.StreamReader File = new System.IO.StreamReader(args[0]);
while ((Line = File.ReadLine()) != null)
{
words = Line.Split(' ');
var BiggestWord = (from word in words
orderby word.Length descending
select word).FirstOrDefault();
Console.WriteLine(BiggestWord.ToString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment