Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: Porsche56253

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-07 11:14:52

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

int main(){
    string a , b ;
    cin >> a >> b ;
    set<char> s(a.begin(), a.end()) ;
    for (char c : b) {
        if (s.count(c)) {
            cout << c << " ";
            s.erase(c);
        }
    }
}