Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: randomguy

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-10 14:13:45

#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <numeric>
#include <set>
#include <algorithm>
#define io() do { ios::sync_with_stdio(false); cin.tie(nullptr); } while(0)
using namespace std;



int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string a;
    cin >> a;
    string b;
    cin >> b;
    unordered_set<char> aa(a.begin(),a.end());
    set<int> apl;
    for(char c:b){
        if(aa.count(c)) apl.insert(c);
    }
    for(char c:apl) cout << c << " ";
}