Beispiel #1
0
        public void Test1()
        {
            /*
             * The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
             */

            var grid = GetGrid();

            var sut = new E011Largestproductinagrid();

            long expected = 70600674;
            var  value    = sut.GetLargestproduct(grid);

            Assert.Equal(expected, value);
        }
Beispiel #2
0
        public void Solution()
        {
            /*
             * What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20×20 grid?
             */

            var grid = GetGrid();

            var sut = new E011Largestproductinagrid();

            long expected = 70600674;
            var  value    = sut.GetLargestproduct(grid);

            Assert.Equal(expected, value);

            /*
             *  Congratulations, the answer you gave to problem 11 is correct.
             *
             *  You are the 207070th person to have solved this problem.
             */
        }