Submission
Status:
[PPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: Folk_DIWA
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-13 00:02:26
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
cin.tie(0)->sync_with_stdio(0);
string a,b;
cin >> a >> b;
map <char,int> freqa, freqb;
for(auto &x : a) freqa[x]++;
for(auto &x : b) freqb[x]++;
set <char> st;
for(int i=0; i<a.size(); i++){
if(freqa.count(a[i]) and freqb.count(a[i])) st.insert(a[i]);
}
for(auto &x : st) cout << x << ' ';
return 0;
}