Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <fstream>
- #include <unordered_map>
- int main() {
- std::ifstream fin("input.txt");
- std::string str1, str2;
- fin >> str1 >> str2;
- std::unordered_map<char, int> abc;
- for (char ch : str1) {
- abc[ch]++;
- }
- for (char ch : str2) {
- if (abc[ch] == 0) {
- std::cout << ch;
- break;
- }
- abc[ch]--;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement