From 663dafc9d34d59eb3fe94b5a05a4ad5117026389 Mon Sep 17 00:00:00 2001 From: 5gam-gayoung Date: Mon, 2 Jan 2023 22:46:10 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Programmers]=20=EC=99=84=EC=A3=BC=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EB=AA=BB=ED=95=9C=20=EC=84=A0=EC=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\353\252\273\355\225\234\354\204\240\354\210\230.js" | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 "[Programmers]/gyyang/hash/\354\231\204\354\243\274\355\225\230\354\247\200\353\252\273\355\225\234\354\204\240\354\210\230.js" diff --git "a/[Programmers]/gyyang/hash/\354\231\204\354\243\274\355\225\230\354\247\200\353\252\273\355\225\234\354\204\240\354\210\230.js" "b/[Programmers]/gyyang/hash/\354\231\204\354\243\274\355\225\230\354\247\200\353\252\273\355\225\234\354\204\240\354\210\230.js" new file mode 100644 index 0000000..41dc5b0 --- /dev/null +++ "b/[Programmers]/gyyang/hash/\354\231\204\354\243\274\355\225\230\354\247\200\353\252\273\355\225\234\354\204\240\354\210\230.js" @@ -0,0 +1,9 @@ +function solution(participant, completion) { + participant.sort(); + completion.sort(); + for(let i = 0; i < participant.length; i++){ + if(participant[i] !== completion[i]){ + return participant[i] + } + } +} \ No newline at end of file From f1318d5067aa5f45f53b5967445945a472d56a83 Mon Sep 17 00:00:00 2001 From: 5gam-gayoung Date: Mon, 2 Jan 2023 22:49:57 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Programmers]=20=ED=8F=AC=EC=BC=93=EB=AA=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gyyang/hash/\355\217\254\354\274\223\353\252\254.js" | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 "[Programmers]/gyyang/hash/\355\217\254\354\274\223\353\252\254.js" diff --git "a/[Programmers]/gyyang/hash/\355\217\254\354\274\223\353\252\254.js" "b/[Programmers]/gyyang/hash/\355\217\254\354\274\223\353\252\254.js" new file mode 100644 index 0000000..d35616c --- /dev/null +++ "b/[Programmers]/gyyang/hash/\355\217\254\354\274\223\353\252\254.js" @@ -0,0 +1,5 @@ +function solution(nums) { + const set = new Set(nums); + const choice = nums.length / 2; + return set.size > choice? choice : set.size +} \ No newline at end of file