Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: mameeewin

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-13 14:53:41

#include <iostream>
#include <set>
using namespace std;

int main(){
  string s1, s2; cin >> s1 >> s2;
  set<char> a, b;
  for (char i: s1) a.insert(i);
  for (char i: s2) if (a.count(i)>0) b.insert(i);
  for (char i: b) cout << i << " ";
}