Submission

Status:
[PPPPPPPP]

Score: 100

User: whatisdp

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

Language: cpp

Time: 0.003 second

Submitted On: 2024-11-10 10:37:36

#include<bits/stdc++.h>
using namespace std;
int main() {
	cin.tie(0)->sync_with_stdio(false);
	map<char,int> mc;
	string s1,s2;
	cin>>s1>>s2;
	for(auto &x:s1) {
		mc[x]=1;
	}
	for(auto &x:s2) {
		if (mc[x]==1) mc[x]=2;
	}
	for(auto &x:mc) {
		if (x.second==2) cout<<x.first<<' ';
	}
}