We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5e9642 commit ebea510Copy full SHA for ebea510
src/main/kotlin/g3301_3400/s3399_smallest_substring_with_identical_characters_ii/Solution.kt
@@ -24,7 +24,7 @@ class Solution {
24
if (flips <= numOps) {
25
return 1
26
}
27
- val seg: MutableList<Int?> = ArrayList<Int?>()
+ val seg: MutableList<Int> = ArrayList<Int>()
28
var count = 1
29
var max = 1
30
for (i in 1..<b.size) {
@@ -57,10 +57,10 @@ class Solution {
57
return res
58
59
60
- private fun check(sz: Int, seg: MutableList<Int?>, ops: Int): Boolean {
+ private fun check(sz: Int, seg: MutableList<Int>, ops: Int): Boolean {
61
var ops = ops
62
for (i in seg) {
63
- val x = i!! / (sz + 1)
+ val x = i / (sz + 1)
64
ops -= x
65
if (ops < 0) {
66
return false
0 commit comments