File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
src/main/kotlin/g3501_3600/s3552_grid_teleportation_traversal Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ package g3501_3600.s3552_grid_teleportation_traversal
5
5
import java.util.LinkedList
6
6
import java.util.Queue
7
7
8
+ @Suppress(" kotlin:S107" )
8
9
class Solution {
9
10
private fun initializePortals (m : Int , n : Int , matrix : Array <String >): Array <MutableList <IntArray >> {
10
11
val portalsToPositions: Array <MutableList <IntArray >> = Array (26 ) { ArrayList () }
@@ -83,14 +84,12 @@ class Solution {
83
84
) {
84
85
return 0
85
86
}
86
-
87
87
val portalsToPositions = initializePortals(m, n, matrix)
88
88
val visited = Array <BooleanArray ?>(m) { BooleanArray (n) }
89
89
val queue: Queue <IntArray > = LinkedList ()
90
90
initializeQueue(queue, visited, matrix, portalsToPositions)
91
-
92
91
var moves = 0
93
- while (! queue.isEmpty ()) {
92
+ while (queue.isNotEmpty ()) {
94
93
var sz = queue.size
95
94
while (sz-- > 0 ) {
96
95
val curr = queue.poll()
You can’t perform that action at this time.
0 commit comments