Skip to content

Commit 3445901

Browse files
committed
Fixed sonar
1 parent adf4ce0 commit 3445901

File tree

3 files changed

+6
-6
lines changed
  • src/main/kotlin/g3501_3600

3 files changed

+6
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Solution {
1616
for (coord in coords) {
1717
val x = coord[0]
1818
val y = coord[1]
19-
xMap.computeIfAbsent(x) { k: Int -> TreeSet<Int>() }.add(y)
20-
yMap.computeIfAbsent(y) { k: Int -> TreeSet<Int>() }.add(x)
19+
xMap.computeIfAbsent(x) { _: Int -> TreeSet<Int>() }.add(y)
20+
yMap.computeIfAbsent(y) { _: Int -> TreeSet<Int>() }.add(x)
2121
allX.add(x)
2222
allY.add(y)
2323
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ class Solution {
4141
ms.put(nums[r], ms.getOrDefault(nums[r], 0) + 1)
4242
primeIndices.add(r)
4343
}
44-
while (!ms.isEmpty() && ms.lastKey()!! - ms.firstKey()!! > k) {
44+
while (ms.isNotEmpty() && ms.lastKey()!! - ms.firstKey()!! > k) {
4545
if (nums[l] < MAXN && isPrime[nums[l]]) {
46-
val count: Int = ms.get(nums[l])!!
46+
val count: Int = ms[nums[l]]!!
4747
if (count == 1) {
4848
ms.remove(nums[l])
4949
} else {
5050
ms.put(nums[l], count - 1)
5151
}
52-
if (!primeIndices.isEmpty() && primeIndices[0] == l) {
52+
if (primeIndices.isNotEmpty() && primeIndices[0] == l) {
5353
primeIndices.removeAt(0)
5454
}
5555
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Solution {
3232
)
3333
dis[0][0][0] = 0.0
3434
pq.add(doubleArrayOf(0.0, 0.0, 0.0, 0.0))
35-
while (!pq.isEmpty()) {
35+
while (pq.isNotEmpty()) {
3636
val cur = pq.poll()
3737
val far = cur[0]
3838
val ma = cur[1].toInt()

0 commit comments

Comments
 (0)