Leetcode_easy766. Toeplitz Matrix

Posted happyamyhope

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Leetcode_easy766. Toeplitz Matrix相关的知识,希望对你有一定的参考价值。

problem

766. Toeplitz Matrix

solution1:

class Solution 
public:
    bool isToeplitzMatrix(vector<vector<int>>& matrix) 
        for(int i=0; i<matrix.size()-1; ++i)
        
            for(int j=0; j<matrix[0].size()-1; ++j)
            
                if(matrix[i][j] != matrix[i+1][j+1]) return false;
            
        
        return true;
    
;

 

参考

1. Leetcode_easy_766. Toeplitz Matrix;

2. Grandyang;

以上是关于Leetcode_easy766. Toeplitz Matrix的主要内容,如果未能解决你的问题,请参考以下文章

Leetcode_easy836. Rectangle Overlap

Leetcode_easy867. Transpose Matrix

Leetcode_easy868. Binary Gap

Leetcode_easy860. Lemonade Change

Leetcode_easy859. Buddy Strings

Leetcode_easy994. Rotting Oranges