From 03385078f14407b2a2b76c63b7b62e96d4746c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=88=EC=9C=A0=EC=A7=84?= Date: Sun, 4 Aug 2024 23:22:43 +0900 Subject: [PATCH] [create (H-Index.py)] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 문제: https://school.programmers.co.kr/learn/courses/30/lessons/42747 - TIL: https://gencomi.tistory.com/entry/99%ED%81%B4%EB%9F%BD3%EA%B8%B0-%EC%BD%94%ED%85%8C%EC%8A%A4%ED%84%B0%EB%94%94-4%EC%9D%BC%EC%B0%A8-TIL-%EC%A0%95%EB%A0%AC --- "Programmers/\354\240\225\353\240\254/H-Index.py" | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 "Programmers/\354\240\225\353\240\254/H-Index.py" diff --git "a/Programmers/\354\240\225\353\240\254/H-Index.py" "b/Programmers/\354\240\225\353\240\254/H-Index.py" new file mode 100644 index 0000000..1716195 --- /dev/null +++ "b/Programmers/\354\240\225\353\240\254/H-Index.py" @@ -0,0 +1,8 @@ +def solution(citations): + citations = sorted(citations, reverse=True) + + for i in range(len(citations)): + if i + 1 > citations[i]: + return i + + return len(citations) \ No newline at end of file