ํ๋ ฌํ ๋๋ฆฌ
-
[Programmers] Lv2. ํ๋ ฌ ํ ๋๋ฆฌ ํ์ ํ๊ธฐ(kotlin)SW Test/Programmers 2022. 9. 9. 11:06
๋ฌธ์ ์์ ํ์ด ํ๋ ฌ ํ์ ๋ก์ง์ ์ธ๋ฑ์ค ํ๋์ฉ ์ด๋ํ๋๋ก ๊ตฌํํ๋ฉด ๋ฉ๋๋ค. queies๋ 1๋ถํฐ ์์ํ๋ -1์ ํด์ฃผ์๋ฉด ๋ฉ๋๋ค. import kotlin.math.* class Solution { fun solution(rows: Int, columns: Int, queries: Array): IntArray { var answer = mutableListOf() val arr = Array(rows){ i -> IntArray(columns){ j -> i*columns + j +1} } queries.forEach{ val fy = it[0] -1 val fx = it[1] -1 val sy = it[2] -1 val sx = it[3] -1 val last = arr[fy][fx] var num..