Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cin>>n>>m;
- char grid[n][m];
- for(int i=0;i<n;i++){
- for(int j=0;j<m;j++){
- cin>>grid[i][j];
- }
- }
- int finalflag=0;
- for(int k=0;k<m;k++){
- vector<string> testing;
- for(int i=0;i<n;i++){
- string temp;
- for(int j=0;j<m;j++){
- if(j!=k)
- temp=temp+grid[i][j];
- }
- testing.push_back(temp);
- }
- int flag=0;
- for(int i=0;i<n;i++){
- for(int j=i+1;j<n;j++){
- if(testing[i]==testing[j])
- {
- flag=1;
- break;
- }
- }
- if(flag)
- break;
- }
- if(flag)
- {
- finalflag=0;
- }
- else{
- finalflag=1;
- break;
- }
- }
- if(finalflag)
- cout<<"Yes\n";
- else
- cout<<"No\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement