Skip to content

Commit 5519b0a

Browse files
committed
Fixed sonar
1 parent d524578 commit 5519b0a

File tree

3 files changed

+4
-4
lines changed
  • src/main/kotlin
    • g3401_3500
    • g3501_3600/s3505_minimum_operations_to_make_elements_within_k_subarrays_equal

3 files changed

+4
-4
lines changed

src/main/kotlin/g3401_3500/s3498_reverse_degree_of_a_string/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Solution {
66
fun reverseDegree(s: String): Int {
77
var ans = 0
88
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)
1010
}
1111
return ans
1212
}

src/main/kotlin/g3401_3500/s3499_maximize_active_section_with_trade_i/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Solution {
1111
var curZeroCount = 0
1212
var lastZeroCount = 0
1313
for (i in 0..<s.length) {
14-
if (s.get(i) == '0') {
14+
if (s[i] == '0') {
1515
curZeroCount++
1616
} else {
1717
if (curZeroCount != 0) {

src/main/kotlin/g3501_3600/s3505_minimum_operations_to_make_elements_within_k_subarrays_equal/Solution.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Solution {
4444

4545
fun remove(num: Int) {
4646
delayedRemovals.put(num, delayedRemovals.getOrDefault(num, 0) + 1)
47-
if (!leftHeap.isEmpty() && num <= leftHeap.peek()!!) {
47+
if (leftHeap.isNotEmpty() && num <= leftHeap.peek()!!) {
4848
sumLeft -= num
4949
sizeLeft--
5050
} else {
@@ -75,7 +75,7 @@ class Solution {
7575
}
7676

7777
fun pruneHeap(heap: PriorityQueue<Int>) {
78-
while (!heap.isEmpty() && delayedRemovals.containsKey(heap.peek())) {
78+
while (heap.isNotEmpty() && delayedRemovals.containsKey(heap.peek())) {
7979
val num: Int = heap.peek()!!
8080
if (delayedRemovals[num]!! > 0) {
8181
heap.poll()

0 commit comments

Comments
 (0)