题目:
题解:
class Solution:def numDecodings(self, s: str) -> int:n = len(s)# a = f[i-2], b = f[i-1], c = f[i]a, b, c = 0, 1, 0for i in range(1, n + 1):c = 0if s[i - 1] != '0':c += bif i > 1 and s[i - 2] != '0' and int(s[i-2:i]) <= 26:c += aa, b = b, creturn c