Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: pann

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-02 06:27:15

#include <iostream>
#include <set>
using namespace std;

int main(){
    string a, b;
    cin >> a >> b;
    set<char> dupe;
    for (int i = 0; i < a.length(); i++){
        for (int j = 0; j < b.length(); j++){
            if (b[j] == a[i]){
                dupe.insert(b[j]);
                break;
            }
        }
    }
    for (auto x: dupe){
        cout << x << " ";
    }
    return 0;
}