public static void Main() { var xmas = new Xmas(25, File.ReadAllLines("input.txt").Select(long.Parse).ToList()); var error = xmas.GetError(); Console.WriteLine($"Part 1: the first number that does not have this property is {error}."); Console.WriteLine($"Part 2: the encryption weaknessd in the XMAS-encrypted list is {xmas.GetWeakness(error)}."); }
public void Part2() { Xmas.FindEncryptionWeakness(_input, invalidNumber: 127) .Should().Be(62); }
public void Part1() { Xmas.FindInvalidNumber(_input, windowSize: 5) .Should().Be(127); }