Skip to content

Commit 78b9556

Browse files
committed
Fixed sonar
1 parent 6f32f20 commit 78b9556

File tree

2 files changed

+4
-4
lines changed
  • src/main/kotlin/g3501_3600
    • s3508_implement_router
    • s3509_maximum_product_of_subsequences_with_an_alternating_sum_equal_to_k

2 files changed

+4
-4
lines changed

src/main/kotlin/g3501_3600/s3508_implement_router/Router.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Router(private val size: Int) {
6565
}
6666

6767
fun getCount(destination: Int, startTime: Int, endTime: Int): Int {
68-
if (map.containsKey(destination)) {
68+
return if (map.containsKey(destination)) {
6969
val list: ArrayList<IntArray> = map[destination]!!
7070
var lower = -1
7171
var higher = -1
@@ -81,13 +81,13 @@ class Router(private val size: Int) {
8181
break
8282
}
8383
}
84-
return if (lower == -1 || higher == -1) {
84+
if (lower == -1 || higher == -1) {
8585
0
8686
} else {
8787
max(0.0, (higher - lower + 1).toDouble()).toInt()
8888
}
8989
} else {
90-
return 0
90+
0
9191
}
9292
}
9393
}

src/main/kotlin/g3501_3600/s3509_maximum_product_of_subsequences_with_an_alternating_sum_equal_to_k/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class Solution {
9595
continue
9696
}
9797
val bs: BitSet = entry.value
98-
if (targetIdx >= 0 && targetIdx < size && bs.get(targetIdx)) {
98+
if (targetIdx >= 0 && targetIdx < size && bs[targetIdx]) {
9999
answer = max(answer.toDouble(), key.prod.toDouble()).toInt()
100100
}
101101
}

0 commit comments

Comments
 (0)