Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- string j, s;
- cin » j » s;
- vector <int> J(27,0), S(27, 0);
- for (size_t i = 0; i < j.size(); ++i) {
- J[j[i] - 'a']++;
- }
- for (size_t i = 0; i < s.size(); ++i) {
- S[s[i] - 'a']++;
- }
- int res = 0;
- for (size_t i = 0; i < 27; ++i) {
- if (J[i])
- res += S[i];
- }
- cout « res;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement