Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
485 B
1
Indexable
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

bool anaAre(const string& a, const string& b) {
    if (a.length() != b.length()) {
        return false;
    }

    string soA = a;
    string soB = b;
    sort(soA.begin(), soA.end());
    sort(soB.begin(), soB.end());

    return soA == soB;
}

int main() {
    string a, b;
    cin >> a >> b;

    if (anaAre(a, b)) {
        cout << "1\n";
    } else {
        cout << "0\n";
    }

    return 0;
}