https://leetcode.com/problems/toeplitz-matrix/ Easy

Решение

class Solution {
    fun isToeplitzMatrix(matrix: Array<IntArray>): Boolean {
        val rows = matrix.size
        val cols = matrix[0].size
        for (i in 1 until rows) {
            for (j in 1 until cols) {
                if (matrix[i][j] != matrix[i - 1][j - 1]) return false
            }
        }
        return true
    }
}