Submission
Status:
[PPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: Nuttykub
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-01 16:38:36
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
string s1,s2;
cin >> s1 >> s2;
set<char> repeat;
for (int i = 0;i < s1.length();i++){
for (int j = 0;j < s2.length();j++){
if (s1[i]==s2[j]){
repeat.insert(s1[i]);
break;
}
}
}
for (char c:repeat) cout << c << " ";
}