Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: solomon

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-22 13:02:57

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

int main(){
    string s;
    cin >> s;
    bool seenA[256] = {false};
    bool seenB[256] = {false};
    for(char c : s)seenA[c] = true;

    cin >> s;
    for(char c : s)seenB[c] = true;

    for(int i = 0;i<256;i++){
        if(seenA[i] && seenB[i]){
            cout << (char)i << ' ';
        }
    }
}