[프로그래머스] K번째수

박정훈·2022년 3월 1일
0

코테 문제 모음

목록 보기
16/34

프로그래머스 K번째수

def solution(array, commands):
    answer = []
    
    size = len(commands)
    for index in range(size):
        i, j, k = commands[index]
        temp = array[i-1:j]
        temp = sorted(temp)
        temp = temp[k -1]
        answer.append(temp)
    
    return answer
profile
그냥 개인적으로 공부한 글들에 불과

0개의 댓글