Esempio n. 1
0
        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)}.");
        }
Esempio n. 2
0
 public void Part2()
 {
     Xmas.FindEncryptionWeakness(_input, invalidNumber: 127)
     .Should().Be(62);
 }
Esempio n. 3
0
 public void Part1()
 {
     Xmas.FindInvalidNumber(_input, windowSize: 5)
     .Should().Be(127);
 }