# Author: Gaurav Pande
#(766. Toeplitz Matrix)[https://leetcode.com/problems/toeplitz-matrix/description/]

class Solution:
    def isToeplitzMatrix(self, matrix):
        """
        :type matrix: List[List[int]]
        :rtype: bool
        """
        return all(r == 0 or c == 0 or matrix[r-1][c-1]== val
               for r, id in enumerate(matrix)
               for c, val in enumerate(id))

b97ef0684eb8ff8baa7101c0a21a588733d8cd02
<mask token>

class Solution:
    <mask token>

class Solution:

    def isToeplitzMatrix(self, matrix):
        """
        :type matrix: List[List[int]]
        :rtype: bool
        """
        return all(r == 0 or c == 0 or matrix[r - 1][c - 1] == val for r,
            id in enumerate(matrix) for c, val in enumerate(id))

# Author: Gaurav Pande
#(766. Toeplitz Matrix)[https://leetcode.com/problems/toeplitz-matrix/description/]

class Solution:
    def isToeplitzMatrix(self, matrix):
        """
        :type matrix: List[List[int]]
        :rtype: bool
        """
        return all(r == 0 or c == 0 or matrix[r-1][c-1]== val
               for r, id in enumerate(matrix)
               for c, val in enumerate(id))
