def solution(array, commands):
    answer = []
    for i in commands:
        arr = array[i[0]-1:i[1]] #자르고
        arr.sort() #정렬
        answer.append((arr[i[2]-1])) #k번째 수 넣기
    return answer

4417f1bb58a431c53bd5e61daf4a11ea974cc817
<mask token>

def solution(array, commands):
    answer = []
    for i in commands:
        arr = array[i[0] - 1:i[1]]
        arr.sort()
        answer.append(arr[i[2] - 1])
    return answer

def solution(array, commands):
    answer = []
    for i in commands:
        arr = array[i[0]-1:i[1]] #자르고
        arr.sort() #정렬
        answer.append((arr[i[2]-1])) #k번째 수 넣기
    return answer
