class Test48 { class Solution { fun rotate(matrix: Array): Unit { for (i in 0..(matrix.size-1)/2){ matrix[i] = matrix[matrix.size-1-i] .also { matrix[matrix.size-1-i] = matrix[i] } } for (i in 1..) { matrix.forEach { row -> println(row.joinToString(prefix = "[", postfix = "]", separator = ",")) } } }