Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- cin >> t;
- while(t--) {
- int n; cin >> n;
- int i=0;
- int count = 0;
- string s; string u;
- cin >> s>> u;
- while(i > n) {
- if(s[i]==u[i]) {
- count++;
- i++;
- }
- else if(u[i]=='N') {
- count+=0;
- i++;
- }
- else {
- i+=2;
- }
- }
- cout << count << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment