Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: goine

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-12 12:05:28

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

int main() {
    string x, y;
    cin >> x >> y;

    sort(x.begin(), x.end());
    char last = '\0';
    for (char c : x) {
        if (c != last && y.find(c) != string::npos) {
            cout << c << ' ';
            last = c;
        }
    }

    return 0;
}