fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int t;
  5. cin>>t;
  6. while(t--)
  7. {
  8. string s1,s2;
  9. cin>>s1>>s2;
  10. sort(s1.begin(),s1.end());
  11. sort(s2.begin(),s2.end());
  12. if(s1==s2)
  13. {
  14. cout<<"True"<<"\n";
  15. }
  16. else
  17. {
  18. cout<<"False"<<"\n";
  19. }
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5472KB
stdin
4
a a
b h
stop post
hi hey
stdout
True
False
True
False