https://programmers.co.kr/learn/courses/30/lessons/42748
코딩테스트 연습 - K번째수
[1, 5, 2, 6, 3, 7, 4] [[2, 5, 3], [4, 4, 1], [1, 7, 3]] [5, 6, 3]
programmers.co.kr
def solution(array, commands):
answer = []
for c in commands:
tmp = array[c[0]-1:c[1]]
tmp.sort()
answer.append(tmp[c[2]-1])
return answer
'STUDY > 코딩테스트 연습문제 풀이' 카테고리의 다른 글
[프로그래머스][정렬] 가장 큰 수 (0) | 2021.08.14 |
---|---|
[프로그래머스][힙] 더 맵게 (0) | 2021.08.11 |
[프로그래머스][해시] 완주하지 못한 선수 (0) | 2021.08.07 |