Source Code
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
#define ll long long
const int  N =26;
int occ[N];
int main() {
    IOS

    int t;cin>>t;
    while(t--){;
        int n;cin>>n;
        string a,b;cin>>a>>b;
        int i=0;
        while(a[i]!=b[0]&&i<n)
            i++;
        cout<<(i?"1\n":"0\n");
    }

};
Copy
Split and Swap HusseinSaad
GNU G++17
2 ms
376 KB
Wrong Answer