Exemplo n.º 1
0
        public void Puzzle2_FundSumOfMinAndMaxOfSetThatAddsToInvalid()
        {
            const long firstInvalid = 138879426L;
            var        system       = new XmasSystem(Input.Day09);

            var set = system.FindSetThatAddsToInvalid(firstInvalid);

            var(min, max) = (set.Min(), set.Max());

            (min + max).Should().Be(23761694L);
        }
Exemplo n.º 2
0
        public void PuzzleExample_FindSetThatAddsToInvalid()
        {
            var expectedSet = new List <long> {
                15, 25, 47, 40
            };
            var system = new XmasSystem(PuzzleExample);

            var actual = system.FindSetThatAddsToInvalid(127);

            actual.Should().BeEquivalentTo(expectedSet);

            var(min, max) = (actual.Min(), actual.Max());

            (min + max).Should().Be(62);
        }