알고리즘

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

HHB 2023. 10. 9. 19:07
def solution(array,commands):
    answer=[]
    for i in range(len(commands)):
        a = array[commands[i][0]-1:commands[i][1]]
        a.sort()
        answer.append(a[commands[i][2]-1])
        
    return answer
728x90
반응형
LIST