liartie

Untitled

Oct 14th, 2022
985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <iterator>
  5. #include <set>
  6. #include <vector>
  7. #include <cmath>
  8. #include <string>
  9.  
  10. using namespace std;
  11.  
  12. int main() {
  13.     string s, t;
  14.     cin>>s;
  15.     cin>>t;
  16.     vector <char> v(s.begin(), s.end());
  17.     set <char> st(t.begin(), t.end());
  18.     auto ans = remove_if (v.begin(), v.end(), [st](char &el){
  19.         return st.count(el) == 1;
  20.      });
  21.     copy(v.begin (), ans, ostream_iterator <char> (cout, ""));
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment