Skip to content

Commit b58cf96

Browse files
aQuaaQua
aQua
authored and
aQua
committed
639 wrong answer
1 parent 1178659 commit b58cf96

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Algorithms/0639.decode-ways-ii/decode-ways-ii.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func numDecodings(s string) int {
2121
}
2222
}
2323

24-
return dp[n]
24+
// 题目要求,返回的结果不能超过 mod
25+
mod := 1000000007
26+
27+
return dp[n] % mod
2528
}
2629

2730
// 检查 s 是否为合格的单字符

Algorithms/0639.decode-ways-ii/decode-ways-ii_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ func Test_Problem0639(t *testing.T) {
2626
ast := assert.New(t)
2727

2828
qs := []question{
29+
question{
30+
para{
31+
"********************",
32+
},
33+
ans{
34+
104671669,
35+
},
36+
},
37+
2938
question{
3039
para{
3140
"*******",

0 commit comments

Comments
 (0)