https://school.programmers.co.kr/learn/courses/30/lessons/42747
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
def solution(citations):
left = 0
right = 10000
result = 0
while left <= right:
mid = (left+right)//2
up = 0
down = 0
for i in citations:
if i >= mid:
up += 1
else:
down += 1
if up >= mid and down <= mid:
result = max(result, mid)
left = mid + 1
else:
right = mid-1
return result
citations[i] >= l-i
def reference(citations):
citations = sorted(citations)
l = len(citations)
for i in range(l):
if citations[i] >= l-i:
return l-i
return 0
[프로그래머스] 프로세스 (1) | 2023.12.20 |
---|---|
[프로그래머스] 할인 행사 (0) | 2023.12.18 |
[프로그래머스] n^2 배열 자르기 (1) | 2023.12.15 |
[프로그래머스] 괄호 회전하기 (0) | 2023.12.15 |
[프로그래머스] 방금 그 곡 (0) | 2023.12.13 |