Skip to content

Commit

Permalink
Merge pull request #550 from ankit137/add
Browse files Browse the repository at this point in the history
Toeplitz-Matrix
  • Loading branch information
MukulCode authored Oct 31, 2022
2 parents cb1e536 + 0cbfe56 commit 7e43f07
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions 766. Toeplitz Matrix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Solution {
public:
bool isToeplitzMatrix(vector<vector<int>>& matrix) {
for(int i=0;i<matrix.size();i++){
for (int j=0;j<matrix[0].size();j++ ){
if(i>0 && j>0 && matrix[i-1][j-1]!=matrix[i][j]){
return false;
}
}
}
return true;
}
};

0 comments on commit 7e43f07

Please sign in to comment.