Beispiel #1
0
        public void Part1Example()
        {
            const string?input = @"35
20
15
25
47
40
62
55
65
95
102
117
150
182
127
219
299
277
309
576";

            var sut = XmasCracker.Parse(input, 5);

            // ACT
            var result = sut.GetFirstInvalidNumber();

            // ASSERT
            result.Should().Be(127);
        }
Beispiel #2
0
        public void Part2Example()
        {
            const string?input = @"35
20
15
25
47
40
62
55
65
95
102
117
150
182
127
219
299
277
309
576";

            var sut = XmasCracker.Parse(input, 5);

            // ACT
            var result = sut.GetEncryptionWeakness();

            // ASSERT
            result.Should().Be(62);
        }
Beispiel #3
0
 protected override long?SolvePart2Impl(string input) => XmasCracker.Parse(input, 25).GetEncryptionWeakness();
Beispiel #4
0
 protected override long?SolvePart1Impl(string input) => XmasCracker.Parse(input, 25).GetFirstInvalidNumber();