예제 #1
0
        public void TestForExample()
        {
            int[] expectedFactorial = new int[] { 3, 6, 2, 8, 8, 0, 0 };
            int[] factorial         = ArrayMath.Factorial(10);

            Assert.AreEqual(expectedFactorial, factorial);
        }
예제 #2
0
        public override long Solution()
        {
            int[] factorial = ArrayMath.Factorial(100);
            long  sum       = 0;

            foreach (int digit in factorial)
            {
                sum += digit;
            }

            return(sum);
        }