From c4d92bd3fd2badaa3bcc75ed5dc70e9d227a0036 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 28 Nov 2024 06:28:04 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=8A=88=20#398=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=86=94=EB=A3=A8=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\355\225\234_\354\204\240\354\210\230.cpp" | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 "Programmers/\354\231\204\354\243\274\355\225\230\354\247\200_\353\252\273\355\225\234_\354\204\240\354\210\230.cpp" diff --git "a/Programmers/\354\231\204\354\243\274\355\225\230\354\247\200_\353\252\273\355\225\234_\354\204\240\354\210\230.cpp" "b/Programmers/\354\231\204\354\243\274\355\225\230\354\247\200_\353\252\273\355\225\234_\354\204\240\354\210\230.cpp" new file mode 100644 index 0000000..b2807e5 --- /dev/null +++ "b/Programmers/\354\231\204\354\243\274\355\225\230\354\247\200_\353\252\273\355\225\234_\354\204\240\354\210\230.cpp" @@ -0,0 +1,26 @@ +#include +#include +#include + +using namespace std; + +string solution(vector participant, vector completion) { + unordered_map 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 ""; +} \ No newline at end of file