8000 Update 1919.cpp · twinkite/basic-algo-lecture@db63f35 · GitHub
[go: up one dir, main page]

Skip to content

Commit db63f35

Browse files
committed
Update 1919.cpp
1 parent b23b74f commit db63f35

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

0x03/solutions/1919.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : twinkite
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/113a0c8415164751b8316d0dcc589658
44
#include <bits/stdc++.h>
55
using namespace std;
66

77
int main(void){
88
ios::sync_with_stdio(0);
99
cin.tie(0);
10-
10+
11+
int res = 0;
12+
string s1, s2;
13+
int arr[2][26];
14+
fill(arr[0], arr[0]+26, 0);
15+
fill(arr[1], arr[1]+26, 0);
16+
cin>>s1>>s2;
17+
for(int i=0;i<s1.size();i++){
18+
arr[0][s1[i]-'a']++;
19+
}
20+
for(int i=0;i<s2.size();i++){
21+
arr[1][s2[i]-'a']++;
22+
}
23+
for(int i=0;i<26;i++){
24+
res+=abs(arr[0][i]-arr[1][i]);
25+
}
26+
cout<<res;
27+
return 0;
1128
}

0 commit comments

Comments
 (0)
0