public static void Main()
Console.WriteLine(numDecodings(s));
public static int numDecodings(String s)
int[] dp = new int[n + 1];
dp[1] = s[1] != '0' ? 1 : 0;
for (int i = 2; i <= s.Length; i++)
int first = Int32.Parse(s.Substring(i - 1, 1));
int second = Int32.Parse(s.Substring(i - 2, 2));
if (first >= 0 && first <= 9)
if (second >= 10 && second <= 26)