Submission
Status:
[PPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: Mocha_nb
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.002 second
Submitted On: 2025-09-25 17:48:33
#include <bits/stdc++.h>
using namespace std;
int main(){
int cnt2[200] = {0};
int cnt1[200] = {0};
string ch1,ch2;
cin >> ch1 >> ch2;
for(char c:ch1){
cnt1[c]++;
}
for(char c:ch2){
cnt2[c]++;
}
for(int i = 0;i<200;i++){
if((cnt1[i] && cnt2[i]) == 0){
continue;
}else{cout << char(i) << ' ';}
}
}