๋ฌธ์ ์ค๋ช
H-Index๋ ๊ณผํ์์ ์์ฐ์ฑ๊ณผ ์ํฅ๋ ฅ์ ๋ํ๋ด๋ ์งํ์ ๋๋ค. ์ด๋ ๊ณผํ์์ H-Index๋ฅผ ๋ํ๋ด๋ ๊ฐ์ธ h๋ฅผ ๊ตฌํ๋ ค๊ณ ํฉ๋๋ค.
์ํค๋ฐฑ๊ณผ์ ๋ฐ๋ฅด๋ฉด, H-Index๋ ๋ค์๊ณผ ๊ฐ์ด ๊ตฌํฉ๋๋ค.
์ด๋ค ๊ณผํ์๊ฐ ๋ฐํํ ๋
ผ๋ฌธ nํธ ์ค, h๋ฒ ์ด์ ์ธ์ฉ๋ ๋
ผ๋ฌธ์ด hํธ ์ด์์ด๊ณ
๋๋จธ์ง ๋
ผ๋ฌธ์ด h๋ฒ ์ดํ ์ธ์ฉ๋์๋ค๋ฉด h์ ์ต๋๊ฐ์ด ์ด ๊ณผํ์์ H-Index์
๋๋ค.
์ด๋ค ๊ณผํ์๊ฐ ๋ฐํํ ๋ ผ๋ฌธ์ ์ธ์ฉ ํ์๋ฅผ ๋ด์ ๋ฐฐ์ด citations๊ฐ ๋งค๊ฐ๋ณ์๋ก ์ฃผ์ด์ง ๋, ์ด ๊ณผํ์์ H-Index๋ฅผ return ํ๋๋ก solution ํจ์๋ฅผ ์์ฑํด์ฃผ์ธ์.
์ ํ์ฌํญ
- ๊ณผํ์๊ฐ ๋ฐํํ ๋ ผ๋ฌธ์ ์๋ 1ํธ ์ด์ 1,000ํธ ์ดํ์ ๋๋ค.
- ๋ ผ๋ฌธ๋ณ ์ธ์ฉ ํ์๋ 0ํ ์ด์ 10,000ํ ์ดํ์ ๋๋ค.
๋ฌธ์ ์์ h
๊ฐ์ citations
์ ๋ฌด์กฐ๊ฑด ํฌํจ๋์ง ์์๋ ๋ฉ๋๋ค.
๋ง์ฝ citations ๊ฐ [5, 5, 5, 5] ๋ผ๋ฉด H-index ๋ 4๊ฐ ๋ฉ๋๋ค.
ํ์ด
def solution(citations):
citations.sort()
max = 0
for i in range(citations[-1]):
count = 0
for s in citations:
if i <= s:
count += 1
if count >= i and max < i :
max = i
break
return max
'Developer > ๐ ์๊ณ ๋ฆฌ์ฆ ๋ฌธ์ ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค/python] ์ ํ๋ฒํธ ๋ชฉ๋ก (0) | 2020.06.17 |
---|---|
[ํ๋ก๊ทธ๋๋จธ์ค/python] ๋ ๋งต๊ฒ (0) | 2020.06.17 |
[ํ๋ก๊ทธ๋๋จธ์ค/python] - ํฐ ์ ๋ง๋ค๊ธฐ (0) | 2020.06.16 |
[ํ๋ก๊ทธ๋๋จธ์ค/python] - ์กฐ์ด์คํฑ (1) | 2020.06.15 |
[ํ๋ก๊ทธ๋๋จธ์ค/python] - ๋ฌธ์์ด ์์ถ (0) | 2020.06.15 |