Source Code
#include <bits/stdc++.h>
typedef long long ll;
#define InAHurry cin.tie(0)->sync_with_stdio(0);
using namespace std;
int main(){
    InAHurry;
    // freopen("input.txt", "r", stdin);
    //  freopen("output.txt", "w", stdout);
  int t;
  cin>>t;
  while(t--) {
      int n;
      cin>>n;
      string a,b;
      cin>>a>>b;
      sort(a.begin(), a.end());
      sort(b.begin(), b.end());
     if(a==b) cout<<"YES\n";
     else cout<<"NO\n";
  }
    return 0;
}
Copy
Moving Digits rama
GNU G++17
1 ms
420 KB
Wrong Answer