Simple solution but I didn't find it in editorial or anywhere else....Am I wrong?


#1

string Solution::solve(vector<vector > &A) {
int n=A.size();
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(A[i][j] != A[(i+1)%n][(j+1)%n])
return “NO”;
}
}
return “YES”;
}.