File tree 2 files changed +4
-3
lines changed
src/main/kotlin/g3401_3500
s3485_longest_common_prefix_of_k_strings_after_removal
s3486_longest_special_path_ii
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class Solution {
43
43
depths[0 ] = 0
44
44
// trie insertion
45
45
for (i in 0 .. < wordLength) {
46
- val letterIndex = word.get(i) .code - ' a' .code
46
+ val letterIndex = word[i] .code - ' a' .code
47
47
if (nodePath[i].children[letterIndex] == null ) {
48
48
nodePath[i].children[letterIndex] = TrieNode ()
49
49
}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package g3401_3500.s3486_longest_special_path_ii
2
2
3
3
// #Hard #2025_03_16_Time_255_ms_(100.00%)_Space_125.42_MB_(100.00%)
4
4
5
+ @Suppress(" kotlin:S107" )
5
6
class Solution {
6
7
fun longestSpecialPath (edges : Array <IntArray >, nums : IntArray ): IntArray {
7
8
val ans = intArrayOf(0 , 1 )
@@ -10,9 +11,9 @@ class Solution {
10
11
val a = edge[0 ]
11
12
val b = edge[1 ]
12
13
val c = edge[2 ]
13
- graph.computeIfAbsent(a) { k : Int -> ArrayList <IntArray >() }
14
+ graph.computeIfAbsent(a) { _ : Int -> ArrayList <IntArray >() }
14
15
.add(intArrayOf(b, c))
15
- graph.computeIfAbsent(b) { k : Int -> ArrayList <IntArray >() }
16
+ graph.computeIfAbsent(b) { _ : Int -> ArrayList <IntArray >() }
16
17
.add(intArrayOf(a, c))
17
18
}
18
19
val costs: MutableList <Int > = ArrayList <Int >()
You can’t perform that action at this time.
0 commit comments