Skip to content

Commit 28663e0

Browse files
committed
Fixed sonar
1 parent 9e58b6c commit 28663e0

File tree

2 files changed

+4
-3
lines changed
  • src/main/kotlin/g3401_3500

2 files changed

+4
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Solution {
4343
depths[0] = 0
4444
// trie insertion
4545
for (i in 0..<wordLength) {
46-
val letterIndex = word.get(i).code - 'a'.code
46+
val letterIndex = word[i].code - 'a'.code
4747
if (nodePath[i].children[letterIndex] == null) {
4848
nodePath[i].children[letterIndex] = TrieNode()
4949
}

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package g3401_3500.s3486_longest_special_path_ii
22

33
// #Hard #2025_03_16_Time_255_ms_(100.00%)_Space_125.42_MB_(100.00%)
44

5+
@Suppress("kotlin:S107")
56
class Solution {
67
fun longestSpecialPath(edges: Array<IntArray>, nums: IntArray): IntArray {
78
val ans = intArrayOf(0, 1)
@@ -10,9 +11,9 @@ class Solution {
1011
val a = edge[0]
1112
val b = edge[1]
1213
val c = edge[2]
13-
graph.computeIfAbsent(a) { k: Int -> ArrayList<IntArray>() }
14+
graph.computeIfAbsent(a) { _: Int -> ArrayList<IntArray>() }
1415
.add(intArrayOf(b, c))
15-
graph.computeIfAbsent(b) { k: Int -> ArrayList<IntArray>() }
16+
graph.computeIfAbsent(b) { _: Int -> ArrayList<IntArray>() }
1617
.add(intArrayOf(a, c))
1718
}
1819
val costs: MutableList<Int> = ArrayList<Int>()

0 commit comments

Comments
 (0)