File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
s3498_reverse_degree_of_a_string
s3499_maximize_active_section_with_trade_i
g3501_3600/s3505_minimum_operations_to_make_elements_within_k_subarrays_equal Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ class Solution {
6
6
fun reverseDegree (s : String ): Int {
7
7
var ans = 0
8
8
for (i in 0 .. < s.length) {
9
- ans + = (26 - (s.get(i) .code - ' a' .code)) * (i + 1 )
9
+ ans + = (26 - (s[i] .code - ' a' .code)) * (i + 1 )
10
10
}
11
11
return ans
12
12
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class Solution {
11
11
var curZeroCount = 0
12
12
var lastZeroCount = 0
13
13
for (i in 0 .. < s.length) {
14
- if (s.get(i) == ' 0' ) {
14
+ if (s[i] == ' 0' ) {
15
15
curZeroCount++
16
16
} else {
17
17
if (curZeroCount != 0 ) {
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class Solution {
44
44
45
45
fun remove (num : Int ) {
46
46
delayedRemovals.put(num, delayedRemovals.getOrDefault(num, 0 ) + 1 )
47
- if (! leftHeap.isEmpty () && num <= leftHeap.peek()!! ) {
47
+ if (leftHeap.isNotEmpty () && num <= leftHeap.peek()!! ) {
48
48
sumLeft - = num
49
49
sizeLeft--
50
50
} else {
@@ -75,7 +75,7 @@ class Solution {
75
75
}
76
76
77
77
fun pruneHeap (heap : PriorityQueue <Int >) {
78
- while (! heap.isEmpty () && delayedRemovals.containsKey(heap.peek())) {
78
+ while (heap.isNotEmpty () && delayedRemovals.containsKey(heap.peek())) {
79
79
val num: Int = heap.peek()!!
80
80
if (delayedRemovals[num]!! > 0 ) {
81
81
heap.poll()
You can’t perform that action at this time.
0 commit comments