Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 1010;
- char s[N], t[N];
- int cnt[26], cnt2[26];
- int main()
- {
- scanf("%s %s", s, t);
- for (int i = 0; s[i]; ++i)
- ++cnt[s[i]-'A'];
- for (int i = 0; t[i]; ++i)
- ++cnt2[t[i]-'A'];
- bool fail = false;
- for (int i = 0; i < 26; ++i) {
- if (cnt[i] != cnt2[i])
- fail = true;
- }
- if (fail) printf("No\n");
- else printf("Yes\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement