Skip to content

Commit ebea510

Browse files
committed
Improved task 3399
1 parent e5e9642 commit ebea510

File tree

1 file changed

+3
-3
lines changed
  • src/main/kotlin/g3301_3400/s3399_smallest_substring_with_identical_characters_ii

1 file changed

+3
-3
lines changed

src/main/kotlin/g3301_3400/s3399_smallest_substring_with_identical_characters_ii/Solution.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Solution {
2424
if (flips <= numOps) {
2525
return 1
2626
}
27-
val seg: MutableList<Int?> = ArrayList<Int?>()
27+
val seg: MutableList<Int> = ArrayList<Int>()
2828
var count = 1
2929
var max = 1
3030
for (i in 1..<b.size) {
@@ -57,10 +57,10 @@ class Solution {
5757
return res
5858
}
5959

60-
private fun check(sz: Int, seg: MutableList<Int?>, ops: Int): Boolean {
60+
private fun check(sz: Int, seg: MutableList<Int>, ops: Int): Boolean {
6161
var ops = ops
6262
for (i in seg) {
63-
val x = i!! / (sz + 1)
63+
val x = i / (sz + 1)
6464
ops -= x
6565
if (ops < 0) {
6666
return false

0 commit comments

Comments
 (0)