Skip to content

Commit 8c5661a

Browse files
committed
Added 1722B - Colourblindness.cpp
1 parent 618e2a4 commit 8c5661a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

1722B - Colourblindness.cpp

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
bool check(string r1, string r2, int n)
10+
{
11+
for(int i=0; i<n;i++)
12+
{
13+
if((r1[i]=='R' && r2[i]!='R') || (r2[i]=='R' && r1[i]!='R'))
14+
return 0;
15+
}
16+
return 1;
17+
}
18+
int main()
19+
{
20+
int t;
21+
cin>>t;
22+
while(t--)
23+
{
24+
int n;
25+
cin>>n;
26+
string r1,r2;
27+
cin>>r1>>r2;
28+
cout<<((check(r1, r2, n))?"YES":"NO")<<endl;
29+
}
30+
return 0;
31+
}

0 commit comments

Comments
 (0)