Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: chs_14

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-01-02 07:42:05

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

bool usedAlpha[256];

int main() {
    string str1, str2;
    cin >> str1 >> str2;
    for (char &c : str1)
    {
        usedAlpha[c] = true;
    }

    for (char &c : str2)
    {
        if (usedAlpha[c]) {
            usedAlpha[c] = false;
            cout << c << ' ';
        }
    }


    return 0;
}