public int SolvePartOne(IEnumerable <string> input) { var bunny = new Bunny(new Tracker()); foreach (var line in input) { bunny.Execute(line.TrimStart()); } return(bunny.CalculateDistance()); }
public static int SolvePartOne() { var bunny = new Bunny(new Tracker()); foreach (var line in Input) { bunny.Execute(line.TrimStart()); } return(bunny.CalculateDistance()); }
public static int SolvePartTwo() { var advancedBunny = new Bunny(new AdvancedTracker()); foreach (var line in Input) { advancedBunny.Execute(line.TrimStart()); if (advancedBunny.ShouldShowDuplicate) { break; } } return(advancedBunny.CalculateDistance()); }
public int SolvePartTwo(IEnumerable <string> input) { var bunny = new Bunny(new AdvancedTracker()); foreach (var line in input) { bunny.Execute(line.TrimStart()); if (bunny.ShouldShowDuplicate) { return(bunny.CalculateDistance()); } } return(bunny.CalculateDistance()); }