Programmer:)
(Python) 프로그래머스 : K번째 수 본문
반응형
def solution(array, commands):
answer = []
for i in commands:
temp = array[i[0]-1:i[1]]
temp.sort()
answer.append(temp[i[2]-1])
return answer
반응형
'프로그래머스 정복 > Python' 카테고리의 다른 글
[Python] 프로그래머스 : 문자열 내림자순으로 배치하기 (0) | 2020.06.25 |
---|---|
(Python) 프로그래머스 : 핸드폰 번호 가리기 (0) | 2020.06.23 |
(Python) 프로그래머스 : 수박수박수박수박수박수? (0) | 2020.06.22 |
(Python) 프로그래머스 : 문자열 다루기 기본 (0) | 2020.06.21 |
(Python) 프로그래머스 : 문자열 내 p와 y의 개수 (0) | 2020.06.18 |
Comments