From b2a98442aa64493e8b855f4e31f9fbb4a345c1f8 Mon Sep 17 00:00:00 2001 From: ParkSangKyu <108622613+sangkyu39@users.noreply.github.com> Date: Sun, 19 Jan 2025 11:54:07 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[sangkyu39]=20programmers=5F=ED=8F=B0?= =?UTF-8?q?=EC=BC=93=EB=AA=AC=5FPython?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sangkyu39.py" | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 "programmers/\355\225\264\354\213\234.\355\217\260\354\274\223\353\252\254/sangkyu39.py" diff --git "a/programmers/\355\225\264\354\213\234.\355\217\260\354\274\223\353\252\254/sangkyu39.py" "b/programmers/\355\225\264\354\213\234.\355\217\260\354\274\223\353\252\254/sangkyu39.py" new file mode 100644 index 0000000..5f708b8 --- /dev/null +++ "b/programmers/\355\225\264\354\213\234.\355\217\260\354\274\223\353\252\254/sangkyu39.py" @@ -0,0 +1,4 @@ +def solution(nums): + if len(set(nums)) < len(nums) / 2: #N/2 마리보다 적은 경우 + return len(set(nums)) + return len(nums)/2 # 종류가 N/2보다 많으면 N/2가 답 \ No newline at end of file From 0024d5a5acae1df22a42327d78684ef9de500f3c Mon Sep 17 00:00:00 2001 From: ParkSangKyu <108622613+sangkyu39@users.noreply.github.com> Date: Sun, 19 Jan 2025 12:25:06 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[sangkyu39]=20programmers=5F=EC=99=84?= =?UTF-8?q?=EC=A3=BC=ED=95=98=EC=A7=80=EB=AA=BB=ED=95=9C=EC=84=A0=EC=88=98?= =?UTF-8?q?=5FPython?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sangkyu39.py" | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 "programmers/\355\225\264\354\213\234.\354\231\204\354\243\274\355\225\230\354\247\200\353\252\273\355\225\234\354\204\240\354\210\230/sangkyu39.py" diff --git "a/programmers/\355\225\264\354\213\234.\354\231\204\354\243\274\355\225\230\354\247\200\353\252\273\355\225\234\354\204\240\354\210\230/sangkyu39.py" "b/programmers/\355\225\264\354\213\234.\354\231\204\354\243\274\355\225\230\354\247\200\353\252\273\355\225\234\354\204\240\354\210\230/sangkyu39.py" new file mode 100644 index 0000000..d78977c --- /dev/null +++ "b/programmers/\355\225\264\354\213\234.\354\231\204\354\243\274\355\225\230\354\247\200\353\252\273\355\225\234\354\204\240\354\210\230/sangkyu39.py" @@ -0,0 +1,8 @@ +def solution(participant, completion): + participant = sorted(participant) + completion = sorted(completion) + + for i in range(len(completion)): + if participant[i] != completion[i]: + return participant[i] + return participant[-1] \ No newline at end of file From 7b18ac2d156bf9dc27bc84846322a35b2f7aaf7b Mon Sep 17 00:00:00 2001 From: ParkSangKyu <108622613+sangkyu39@users.noreply.github.com> Date: Sun, 19 Jan 2025 12:39:07 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[sangkyu39]=20programmers=5F=EC=99=84?= =?UTF-8?q?=EC=A3=BC=ED=95=98=EC=A7=80=EB=AA=BB=ED=95=9C=EC=84=A0=EC=88=98?= =?UTF-8?q?=5FPython?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sangkyu39.py" | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 "programmers/\355\225\264\354\213\234.\355\217\260\354\274\223\353\252\254/sangkyu39.py" diff --git "a/programmers/\355\225\264\354\213\234.\355\217\260\354\274\223\353\252\254/sangkyu39.py" "b/programmers/\355\225\264\354\213\234.\355\217\260\354\274\223\353\252\254/sangkyu39.py" deleted file mode 100644 index 5f708b8..0000000 --- "a/programmers/\355\225\264\354\213\234.\355\217\260\354\274\223\353\252\254/sangkyu39.py" +++ /dev/null @@ -1,4 +0,0 @@ -def solution(nums): - if len(set(nums)) < len(nums) / 2: #N/2 마리보다 적은 경우 - return len(set(nums)) - return len(nums)/2 # 종류가 N/2보다 많으면 N/2가 답 \ No newline at end of file