https://school.programmers.co.kr/learn/courses/30/lessons/42747
나의 풀이
def solution(citations):
citations.sort()
for index, i in enumerate(citations):
if len(citations) - index == i:
return i
문제 이해 후 나의 풀이
def solution(citations):
citations.sort()
for index, i in enumerate(citations):
if len(citations) - index <= i:
return len(citations) - index
return 0
후기
- 프로그래머스에 써져있는 문제로는 정확히 문제를 이해할 수 없었다.
- 구글링 하여 h-index의 정확한 개념을 다시 이해했다.
- 문제만 이해하면 푸는것은 아주 쉬운 문제이다.
https://www.ibric.org/myboard/read.php?Board=news&id=270333
'알고리즘 > 알고리즘 문제' 카테고리의 다른 글
[python] 프로그래머스 > 연속된 부분 수열의 합 (0) | 2023.05.29 |
---|---|
[python] 프로그래머스 > 마법의 엘리베이터 (0) | 2023.05.25 |
[python] 프로그래머스 > 이진변환반복하기 (0) | 2023.05.18 |
[python] 프로그래머스 > 뒤에 있는 큰 수 찾기 (0) | 2023.05.18 |
[python] 백준 > 그리디 > 회의실 배정(1931) (0) | 2021.03.30 |