Skip to content

Commit 56f01a9

Browse files
committed
Fixed sonar
1 parent 4884b15 commit 56f01a9

File tree

2 files changed

+3
-3
lines changed
  • src/main/kotlin/g3501_3600
    • s3568_minimum_moves_to_clean_the_classroom
    • s3569_maximize_count_of_distinct_primes_after_split

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Solution {
4242
queue.offer(State(startX, startY, energy, 0, 0))
4343
visited[startX][startY][0] = energy
4444
val dirs = arrayOf<IntArray>(intArrayOf(0, 1), intArrayOf(1, 0), intArrayOf(0, -1), intArrayOf(-1, 0))
45-
while (!queue.isEmpty()) {
45+
while (queue.isNotEmpty()) {
4646
val curr = queue.poll()
4747
if (curr.mask == allMask) {
4848
return curr.steps

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Solution {
7777
val primeIndices: MutableMap<Int, TreeSet<Int>> = HashMap()
7878
for (i in 0..<n) {
7979
if (isPrime[nums[i]]) {
80-
primeIndices.computeIfAbsent(nums[i]) { k: Int? -> TreeSet<Int>() }.add(i)
80+
primeIndices.computeIfAbsent(nums[i]) { _: Int -> TreeSet<Int>() }.add(i)
8181
}
8282
}
8383
val segmentTree = SegmentTree(n)
@@ -115,7 +115,7 @@ class Solution {
115115
nums[idx] = `val`
116116
if (isPrime[`val`]) {
117117
val wasNewPrime = !primeIndices.containsKey(`val`)
118-
val indices = primeIndices.computeIfAbsent(`val`) { k: Int? -> TreeSet<Int>() }
118+
val indices = primeIndices.computeIfAbsent(`val`) { _: Int -> TreeSet<Int>() }
119119
val oldFirst: Int = (if (indices.isEmpty()) -1 else indices.first())!!
120120
val oldLast: Int = (if (indices.isEmpty()) -1 else indices.last())!!
121121
indices.add(idx)

0 commit comments

Comments
 (0)