Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: nate213121

Problemset: สตริงซ้ำซ้ำ

Language: cpp

Time: 0.002 second

Submitted On: 2026-09-02 19:51:30

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s1, s2;
    cin >> s1 >> s2;

    map<char, pair<bool, bool>> m;
    for(auto& c:s1)
    {
        m[c].first = true;
    }

    for(auto& c:s2)
    {
        m[c].second = true;
    }

    for(auto& x:m)
    {
        if(x.second.first == true && x.second.second == true)
        {
            cout << x.first <<  " ";
        }
    }
    return 0;
}