예제 #1
0
        public void Example2_FindsDifferencesCorrectly()
        {
            var adapters = new JoltageAdapters(Example2);

            adapters.GetDifferences().Should().Be((22, 10));
            adapters.Permutations.Should().Be(19208L);
        }
예제 #2
0
        public void Example1_Adapters_AreUpdatedAndSortedProperly()
        {
            var adapters = new JoltageAdapters(Example1);

            adapters.Should().HaveCount(13).And.BeInAscendingOrder().And.StartWith(0).And.EndWith(22);

            adapters.GetDifferences().Should().Be((7, 5));
            adapters.Permutations.Should().Be(8L);
        }
예제 #3
0
        public void Puzzle1And2_FindProductOfDifferencesOf1AndOf3_AndPermutations()
        {
            var adapters = new JoltageAdapters(Input.Day10);

            var(of1, of3) = adapters.GetDifferences();

            (of1 * of3).Should().Be(2432);
            adapters.Permutations.Should().Be(453551299002368L);
        }