Source Code
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;

void solve() {
  string s;
  string t;
  int n;
  cin >> n;
  cin >> s >> t; 
  if (s == t) {
    cout << 0 << endl;
  } else {
    cout << 1 << endl;
  }
}

int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }

  return 0;
}
Copy
Split and Swap CPX99
GNU G++17
74 ms
1.0 MB
Accepted