Skip to content

Commit f3d6104

Browse files
committed
update
1 parent cdd824c commit f3d6104

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/decode-ways-ii.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Solution {
88
static const int W = 3;
99
vector<long long> dp(W);
1010
dp[0] = 1;
11-
dp[1] = s[0] == '*' ? 9 : (s[0] != '0' ? 1 : 0);
11+
dp[1] = s[0] == '*' ? 9 : (s[0] != '0' ? dp[0] : 0);
1212
for (int i = 1; i < s.length(); ++i) {
1313
if (s[i] == '*') {
1414
dp[(i + 1) % W] = 9 * dp[i % W];

0 commit comments

Comments
 (0)