At each position i, you have up to choices: take digit or take digits. This is a classic DP problem.
Define dp[i] as the number of ways to decode s[0..i-1]. If s[i-1] is not '0', you can take it as a single digit, so dp[i] += dp[i-1]. If s[i-2..i-1] forms a number between and , you can take both digits together, so dp[i] += dp[i-2].
Base cases: dp[0] = 1 (empty string has one way), dp[1] = 1 if s[0] != '0', else . Zeros are only valid as the second digit of or .