You are viewing a single comment's thread. Return to all comments →
** C++ solution**
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t>0) { int n,flag=0; cin>>n; int arr[n][n]; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) cin>>arr[i][j]; } for(int i=0;i<n;i++) { for(int j=0;j<n-1;j++) { if(arr[i][j]==arr[i][j+1]) flag=1; } } if(flag==0) cout<<"Yes"<<endl; else cout<<"No"<<endl; t--; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Customized Chess Board
You are viewing a single comment's thread. Return to all comments →
** C++ solution**