File tree 3 files changed +2
-3
lines changed
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 Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ class ExamRoom() {
50
50
var maxAtLeft: Node ? = null
51
51
var cur = tail.pre
52
52
while (cur != = head && cur!! .pre != = head) {
53
- val pre = cur!! .pre
53
+ val pre = cur.pre
54
54
val at = (cur.`val ` + pre!! .`val `) / 2
55
55
val distance = at - pre.`val `
56
56
if (distance >= max) {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class Solution {
30
30
curr = curr!! .next
31
31
key + = curr!! .`val `
32
32
}
33
- map.getValue(preSum).next = curr!! .next
33
+ map.getValue(preSum).next = curr.next
34
34
} else {
35
35
map[preSum] = curr
36
36
}
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package g2801_2900.s2815_max_pair_sum_in_an_array
3
3
// #Easy #Array #Hash_Table #2023_12_06_Time_223_ms_(82.35%)_Space_37.6_MB_(100.00%)
4
4
5
5
import java.util.PriorityQueue
6
- import kotlin.collections.HashMap
7
6
import kotlin.math.max
8
7
9
8
@Suppress(" NAME_SHADOWING" )
You can’t perform that action at this time.
0 commit comments