์ฝ๋ฉํ ์คํธ
๋ฆฌํธ์ฝ๋ 994 Rotting Oranges - Kotlin ํ์ ์ ๋ฐ๋ฅธ ์๊ฐ ๋จ์ถ ํ
https://leetcode.com/problems/rotting-oranges/description/ ๋ฌธ์ ํ์ด ์ด ๋ฌธ์ ๋ matrix ํ์์ ๊ตฌํํ๋ ๊ฐ๋จํ ๋ฌธ์ ์ ๋๋ค. ์ ์๊ฐ์ ๋ฐ๋ผ ์์ฑํ ๋ต์์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. class Solution { private val diff = listOf(0 to 1, 1 to 0, 0 to -1, -1 to 0) fun orangesRotting(grid: Array): Int { val m = grid.size val n = grid.first().size var rotCount = 0 val fresh = ArrayDeque>() for ((y, row) in grid.withI..