示例#1
0
        public static void Part1(string[] input)
        {
            Helper.PrintChallengePart("Part 1");

            XmasSystem xmas   = new XmasSystem(input);
            long       result = xmas.FindInvalidData(25);

            Console.WriteLine("Invalid: " + result);
        }
示例#2
0
        public static void Part2(string[] input)
        {
            Helper.PrintChallengePart("Part 2");

            XmasSystem xmas   = new XmasSystem(input);
            long       result = xmas.FindInvalidData(25);
            long       sum    = xmas.FindContiguousSet(result);

            Console.WriteLine("Contiguous Sum: " + sum);
        }
示例#3
0
        public void Day9Part1()
        {
            // Arrange
            string[] input = Helper.ParseInput(@"Inputs\\Day9_example.txt");

            //Act
            XmasSystem xmas   = new XmasSystem(input);
            long       result = xmas.FindInvalidData(5);

            //Assert
            Assert.AreEqual(127, result);
        }
示例#4
0
        public void Day9Part2()
        {
            // Arrange
            string[] input = Helper.ParseInput(@"Inputs\\Day9_example.txt");

            //Act
            XmasSystem xmas   = new XmasSystem(input);
            long       result = xmas.FindInvalidData(5);
            long       sum    = xmas.FindContiguousSet(result);

            //Assert
            Assert.AreEqual(62, sum);
        }