Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: mister_o_hater_no1

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-09-11 15:44:38

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

int main() {
    cin.tie(nullptr)->sync_with_stdio(0);
    string f, s;cin>> f>> s;
    int count1[66]= {0}, count2[66]= {0};
    for (int i= 0; i< f.length(); ++i) {
    	if(count1[f[i]- 65]> 0) continue;
    	count1[f[i]- 65]++;
    }
    for (int i= 0; i< s.length(); ++i) {
    	if(count2[s[i]- 65]> 0) continue;
    	count2[s[i]- 65]++;
    }
    for (int i= 0; i< 65; ++i) {
    	if(count1[i]> 0 && count2[i]> 0) cout<< char(i+ 65)<< " ";
    }

    return 0;
}