Skip to content

Commit 31a903d

Browse files
committed
Update index.kt
1 parent 6ab0783 commit 31a903d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

count-ways-to-build-good-string/index.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.github.masx200.leetcode_test.count_ways_to_build_good_string
22

3-
const val mod = 1e9 + 7;
3+
const val mod = (1e9 + 7).toInt();
44

55
class Solution {
66
fun countGoodStrings(low: Int, high: Int, zero: Int, one: Int): Int {
@@ -10,8 +10,8 @@ class Solution {
1010
for (i in 1..high) {
1111
if (i >= zero) dp[i] += dp[i - zero];
1212
if (i >= one) dp[i] += dp[i - one];
13-
dp[i] = (dp[i] % mod).toInt();
14-
if (i >= low) ans = ((ans + dp[i]) % mod).toInt();
13+
dp[i] = (dp[i] % mod);
14+
if (i >= low) ans = ((ans + dp[i]) % mod);
1515
}
1616
return ans;
1717
}

0 commit comments

Comments
 (0)