Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- namespace ChrisMayor.codechallenge
- {
- class Program
- {
- static void Main(string[] args)
- {
- var program = new Program();
- program.CountUnSecureRows();
- }
- private void CountUnSecureRows()
- {
- var unsecureLines = ReadFile().Where(line => IsNotSecure(line)).Count();
- }
- public bool IsNotSecure(string input)
- {
- var splitstring = input.Split(" ");
- var group = splitstring.GroupBy(x => x);
- return group.Any(v => v.Count() > 1);
- }
- private string[] ReadFile()
- {
- return File.ReadAllLines(@"C:\Projekt\challange\OwR3bW9NuaZNNLtukKN5GeGPOnH2_full-words_input.txt");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement