Approach hintTry it first, then revealHide
Let dp[i] count the decodings of the first i characters: add dp[i - 1] when the last digit is not 0, and add dp[i - 2] when the last two digits form a number from 10 to 26.
Let dp[i] count the decodings of the first i characters: add dp[i - 1] when the last digit is not 0, and add dp[i - 2] when the last two digits form a number from 10 to 26.