using System.Collections.Generic;
public static void Main()
Console.WriteLine("Welcome to the FHLB Coding Challenge");
var fileParser = new FhlbFileParser();
var dirExists = Directory.Exists(@".\Resources");
var filePaths = dirExists == false
: Directory.GetFiles(@".\Resources", "*.csv");
foreach (var filepath in filePaths)
var file = File.ReadAllLines(filepath);
var distinctWordsDelimitedString = fileParser.RemoveDuplicates(file, delimiter: ",");
Console.WriteLine("RemoveDuplicates returned a count of " + distinctWordsDelimitedString.Split(',').Length);
var duplicateWordsList = fileParser.ReturnOnlyDuplicates(file);
Console.WriteLine("ReturnOnlyDuplicates returned a count of " + duplicateWordsList.Count);
var duplicatesDTOArray = fileParser.ReturnDuplicatesDTO(file);
Console.WriteLine("ReturnDuplicatesDTO returned a count of " + duplicatesDTOArray.Length);
var mostOftenRepeatedWord = duplicatesDTOArray.FirstOrDefault(word => word.MostRepeated);
Console.WriteLine("The most often repeated word was: " + mostOftenRepeatedWord?.Word + ", and was repeated " + mostOftenRepeatedWord?.Count + " times.");
Console.WriteLine("This concludes the FHLB Coding Challenge!");
Console.WriteLine("Thank you for participating!");
public class FhlbFileParser
public string RemoveDuplicates(string[] file, string delimiter)
throw new NotImplementedException();
public List<string> ReturnOnlyDuplicates(string[] file)
throw new NotImplementedException();
public DuplicatesDTO[] ReturnDuplicatesDTO(string[] file)
throw new NotImplementedException();