File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
src/main/kotlin/g3501_3600/s3515_shortest_path_in_a_weighted_tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class Solution {
29
29
edgeWeight = IntArray (n + 1 )
30
30
dfs(1 , 0 , 0 )
31
31
val fenw = Fen (n)
32
- val ansList: MutableList <Int ? > = ArrayList <Int ? >()
32
+ val ansList: MutableList <Int > = ArrayList <Int >()
33
33
for (query in queries) {
34
34
if (query[0 ] == 1 ) {
35
35
val u = query[1 ]
@@ -54,7 +54,7 @@ class Solution {
54
54
}
55
55
val answer = IntArray (ansList.size)
56
56
for (i in ansList.indices) {
57
- answer[i] = ansList.get(i) !!
57
+ answer[i] = ansList[i]
58
58
}
59
59
return answer
60
60
}
@@ -77,11 +77,7 @@ class Solution {
77
77
}
78
78
79
79
private class Fen (var n : Int ) {
80
- var fenw: IntArray
81
-
82
- init {
83
- fenw = IntArray (n + 2 )
84
- }
80
+ var fenw: IntArray = IntArray (n + 2 )
85
81
86
82
fun update (i : Int , delta : Int ) {
87
83
var i = i
You can’t perform that action at this time.
0 commit comments