Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: Darleneee93

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

Language: cpp

Time: 0.003 second

Submitted On: 2026-10-15 10:54:10

#include <bits/stdc++.h>
using namespace std;

#define float double
#define ll long long
#define el << '\n'

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    string a,b;
    cin >> a >> b;
    set<char> ans;

    for(int i=0;i<a.length();i++){
        if (b.find(a[i]) != string::npos) {
            ans.insert(a[i]);
        }
    }

    for(auto j: ans){
        cout << j << " ";
    }
}