Пример #1
0
        public void PuzzlePartOne()
        {
            //  Arrange
            var input = File
                        .ReadLines("tests/y2020/Day9.Input.txt")
                        .Select(x => Convert.ToInt64(x));

            // Act
            var actual = EncodingError.FirstInvalidNumber(input, 25);

            // Assert
            Assert.Equal(2089807806, actual);
        }
Пример #2
0
        public void PuzzleOne()
        {
            // Arrange
            var input = new long[] {
                35, 20, 15, 25, 47, 40, 62, 55, 65, 95, 102, 117, 150, 182, 127, 219, 299, 277, 309, 576
            };

            // Act
            var actual = EncodingError.FirstInvalidNumber(input, 5);

            // Assert
            Assert.Equal(127, actual);
        }