Created
June 2, 2014 20:09
-
-
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/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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