https://projecteuler.net/problem=4
public class Euler4_Palindrome { int product; string productString; string reversedProductString; ListpalindromeList = new List (); public int Solve() { for (int i = 999; i > 99; i--) { for (int j = 999; j > 99; j--) { product = i * j; productString = product.ToString(); reversedProductString = Reverse(productString); if (productString == reversedProductString) palindromeList.Add(product); } } palindromeList.Sort(); return palindromeList.Last(); } public static string Reverse(string s) { char[] charArray = s.ToCharArray(); Array.Reverse(charArray); return new string(charArray); } }