Skip to content

Commit

Permalink
이슈 #398에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 28, 2024
1 parent 7cfc3a5 commit c4d92bd
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Programmers/완주하지_못한_선수.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <string>
#include <vector>
#include <unordered_map>

using namespace std;

string solution(vector<string> participant, vector<string> completion) {
unordered_map<string, int> m;

for (string str : participant) {
m[str]++;
}

for (string str : completion) {
m[str]--;
}


for (auto pair : m) {
if (pair.second >= 1) {
return pair.first;
}
}

return "";
}

0 comments on commit c4d92bd

Please sign in to comment.