Skip to content

Commit 095a9bf

Browse files
committed
Fixed sonar
1 parent 187fdf3 commit 095a9bf

File tree

2 files changed

+2
-2
lines changed
  • src/main/kotlin/g3301_3400
    • s3395_subsequences_with_a_unique_middle_mode_i
    • s3396_minimum_number_of_operations_to_make_elements_in_array_distinct

2 files changed

+2
-2
lines changed

src/main/kotlin/g3301_3400/s3395_subsequences_with_a_unique_middle_mode_i/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Solution {
88
// Create a dictionary to store indices of each number
99
val dict: MutableMap<Int?, MutableList<Int?>?> = HashMap<Int?, MutableList<Int?>?>()
1010
for (i in 0..<n) {
11-
dict.computeIfAbsent(a[i]) { k: Int? -> java.util.ArrayList<Int?>() }!!.add(i)
11+
dict.computeIfAbsent(a[i]) { _: Int? -> java.util.ArrayList<Int?>() }!!.add(i)
1212
}
1313
var ans = 0L
1414
// Iterate over each unique number and its indices

src/main/kotlin/g3301_3400/s3396_minimum_number_of_operations_to_make_elements_in_array_distinct/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Solution {
1010
var dupct = 0
1111
for (num in nums) {
1212
map.put(num, map.getOrDefault(num, 0)!! + 1)
13-
if (map.get(num) == 2) {
13+
if (map[num] == 2) {
1414
dupct++
1515
}
1616
}

0 commit comments

Comments
 (0)