Skip to content

Commit

Permalink
이슈 #313에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 19, 2024
1 parent 0795272 commit d076943
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Programmers/배열의_유사도.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <string>
#include <vector>
#include <unordered_set>

using namespace std;

int solution(vector<string> s1, vector<string> s2) {
int answer = 0;
unordered_set<string> set(s1.begin(), s1.end());

for (string str : s2) {
if (set.find(str) != set.end()) {
answer++;
}
}

return answer;
}

0 comments on commit d076943

Please sign in to comment.