Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- main()
- {
- string first_str, second_str;
- cin >> first_str >> second_str;
- int count = max(first_str.size(), second_str.size()), temp;
- temp = count;
- for (int i = 0; i < first_str.size(); i++)
- {
- for (int j = 0; j < second_str.size(); j++)
- {
- if (first_str[i] == second_str[j])
- {
- temp--;
- break;
- }
- }
- if(temp < count)
- {
- break;
- }
- }
- if (temp <= 0)
- {
- count = -1;
- }
- cout << count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement