Skip to content

Commit 317a8b8

Browse files
authored
Resolved Sonar warnings
1 parent 46570f8 commit 317a8b8

File tree

3 files changed

+2
-3
lines changed
  • src/main/kotlin
    • g0801_0900/s0855_exam_room
    • g1101_1200/s1171_remove_zero_sum_consecutive_nodes_from_linked_list
    • g2801_2900/s2815_max_pair_sum_in_an_array

3 files changed

+2
-3
lines changed

src/main/kotlin/g0801_0900/s0855_exam_room/ExamRoom.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ExamRoom() {
5050
var maxAtLeft: Node? = null
5151
var cur = tail.pre
5252
while (cur !== head && cur!!.pre !== head) {
53-
val pre = cur!!.pre
53+
val pre = cur.pre
5454
val at = (cur.`val` + pre!!.`val`) / 2
5555
val distance = at - pre.`val`
5656
if (distance >= max) {

src/main/kotlin/g1101_1200/s1171_remove_zero_sum_consecutive_nodes_from_linked_list/Solution.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Solution {
3030
curr = curr!!.next
3131
key += curr!!.`val`
3232
}
33-
map.getValue(preSum).next = curr!!.next
33+
map.getValue(preSum).next = curr.next
3434
} else {
3535
map[preSum] = curr
3636
}

src/main/kotlin/g2801_2900/s2815_max_pair_sum_in_an_array/Solution.kt

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package g2801_2900.s2815_max_pair_sum_in_an_array
33
// #Easy #Array #Hash_Table #2023_12_06_Time_223_ms_(82.35%)_Space_37.6_MB_(100.00%)
44

55
import java.util.PriorityQueue
6-
import kotlin.collections.HashMap
76
import kotlin.math.max
87

98
@Suppress("NAME_SHADOWING")

0 commit comments

Comments
 (0)