首页 > 其他 > 详细

【Leetcode_easy】766. Toeplitz Matrix

时间:2019-07-17 18:01:19      阅读:67      评论:0      收藏:0      [点我收藏+]

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_easy】766. Toeplitz Matrix

原文:https://www.cnblogs.com/happyamyhope/p/11202577.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!