Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: Krovmoroz

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-11-06 11:18:56

#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr);
  string a,b;
  unordered_set<char> s,h;
  cin >> a >> b;
  
  for (char c:a) s.insert(c);
  for (char c:b) {
    if (s.count(c) && !h.count(c)) h.insert(c),cout << c << ' ';
  }
}