コード例 #1
0
        public void IsPalindrome_ShouldReturnTrueIfItIs()
        {
            bool expected = true;
            bool actual   = Lingo.CheckIfPalindrome("a78087a");

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public string GetResult()
        {
            for (int i = 999; i > 99; i--)
            {
                for (int j = 999; j > 99 - 1; j--)
                {
                    int product = (i * j);
                    if (Lingo.CheckIfPalindrome(product.ToString()))
                    {
                        palindromes.Add(product);
                    }
                }
            }

            if (palindromes.Count() > 0)
            {
                palindromes.Sort();
                palindromes.Reverse();
                return(palindromes.ElementAt(0).ToString());
            }
            else
            {
                return(string.Empty);
            }
        }
コード例 #3
0
        public void IsPalindrome_ShouldReturnTrueIfItIsNot()
        {
            bool expected = false;
            bool actual   = Lingo.CheckIfPalindrome("78sdfssaa!3s87");

            Assert.Equal(expected, actual);
        }