[ํ๋ก๊ทธ๋๋จธ์ค-Lv2] H-index / Python
๐ Problem Solving/Programmers
import sys
input = sys.stdin.readline
citations = list(map(int, input().split()))
def solution(citations):
citations.sort()
for i in range(len(citations)):
if len(citations) - i <= citations[i]:
return len(citations) - i
return 0
print(solution(citations))
ํด์ค
์ฐ์ , ๋ฆฌ์คํธ๋ฅผ ์ ๋ ฌํ๋ค. ๋ฐ๋ณต๋ฌธ์ ํตํด ํ์ฌ ๊ฐ์ด ๋ฆฌ์คํธ์ ๊ธธ์ด - ์ธ๋ฑ์ค ๊ฐ๋ณด๋ค ํฌ๊ฑฐ๋ ๊ฐ์์ง๋ ๊ฒฝ์ฐ์ ๊ธธ์ด-์ธ๋ฑ์ค๋ฅผ ๋ฆฌํดํ๋ค.
h๋ฒ ์ดํ๋ก ์ธ์ฉ๋ ๋ ผ๋ฌธ์ ์์์ ์ค๋ช ํ ์กฐ๊ฑด์ ์ถฉ์กฑํ ๋ ์ต๋๊ฐ์ด ๋๋ค.
'๐ Problem Solving > Programmers' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค-Lv2] ์ฃผ์๊ฐ๊ฒฉ / Python (0) | 2021.06.15 |
---|---|
[ํ๋ก๊ทธ๋๋จธ์ค-Lv2] ํฐ ์ ๋ง๋ค๊ธฐ / Python (0) | 2021.06.14 |
[ํ๋ก๊ทธ๋๋จธ์ค-Lv2] ๋ค๋ฆฌ๋ฅผ ์ง๋๋ ํธ๋ญ / Python (0) | 2021.06.14 |
[ํ๋ก๊ทธ๋๋จธ์ค-Lv2] ์์ฅ / Python (0) | 2021.06.14 |
[ํ๋ก๊ทธ๋๋จธ์ค-Lv2] ์นดํซ / Python (0) | 2021.06.14 |