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