File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/main/kotlin/g3301_3400
s3398_smallest_substring_with_identical_characters_i
s3399_smallest_substring_with_identical_characters_ii Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11package g3301_3400.s3398_smallest_substring_with_identical_characters_i
22
3- // #Hard #2024_12_24_Time_1_ms_ (100.00%)_Space_42.9_MB_(39.83 %)
3+ // #Hard #2024_12_24_Time_2_ms_ (100.00%)_Space_36.4_MB_(92.86 %)
44
55class Solution {
66 fun minLength (s : String , ops : Int ): Int {
Original file line number Diff line number Diff line change 11package g3301_3400.s3399_smallest_substring_with_identical_characters_ii
22
3- // #Hard #2024_12_24_Time_11_ms_ (100.00%)_Space_45 .7_MB_(54.55 %)
3+ // #Hard #2024_12_24_Time_22_ms_ (100.00%)_Space_40 .7_MB_(100.00 %)
44
55class Solution {
66 fun minLength (s : String , numOps : Int ): Int {
77 val l = s.length
88 var lingyi = 0
99 var yiling = 0
1010 val pq: MutableList <Int > = ArrayList <Int >()
11- var thisone = s.get( 0 )
11+ var thisone = s[ 0 ]
1212 var chang = 1
1313 if (thisone == ' 0' ) {
1414 yiling++
1515 } else {
1616 lingyi++
1717 }
1818 for (i in 1 .. < l) {
19- val cur = s.get(i)
19+ val cur = s[i]
2020 if (cur == thisone) {
2121 chang++
2222 } else {
You can’t perform that action at this time.
0 commit comments