로딩
요청 처리 중입니다...

[C++] 완주하지 못한 선수

 [C++] 완주하지 못한 선수

문제 소스 코드 #include #include #include #include using namespace std; string solution(vector participant, vector completion) { unordered_map m; for(auto part:participant) { if(m.end() == m.find(part)) m.insert(make_pair(part, 1)); else m[part]++; } for(auto com:completion) m[com] -= 1 ; for(auto elem : participant) { if(m[elem] > 0) return elem; } } /* 1. key, value setting 2. update key 3. find key using second value */ 링크 htt...