백준 11328 문제와 유사하다.
11328 문제의 best solution을 이용하여 쉽게 풀었다.
#include <bits/stdc++.h>
using namespace std;
int main(void){
ios::sync_with_stdio(0);
cin.tie(0);
string s1, s2;
int a[26] = {}, value = 0;
cin >> s1 >> s2;
for(char c : s1) a[c-'a']++;
for(char c : s2) a[c-'a']--;
for(int i : a) if(i != 0) value += abs(i);
cout << value;
}
인자의 절댓값을 반환해주는 abs function
유용히 사용할 것 같다.