티스토리 뷰
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 i in range(len(commands)):
i, j, k = commands[i][0], commands[i][1], commands[i][2]
tmp = sorted(array[i-1:j])
answer.append(tmp[k-1])
return answer'Algorithm > Programmers' 카테고리의 다른 글
| [프로그래머스] 베스트앨범 - Python (0) | 2021.03.03 |
|---|---|
| [프로그래머스] 체육복 - Python (0) | 2021.02.28 |
| [프로그래머스] 신규 아이디 추천 - Python (0) | 2021.02.27 |
| [프로그래머스] 소수 찾기 (2) - Python (0) | 2021.02.25 |
| [프로그래머스] 소수 찾기 - Python (0) | 2021.02.24 |
