def solution(array, commands):
answer = []
for a in commands:
ext_array = []
for b in range(a[0]-1,a[1]):
ext_array.append(array[b])
# 정렬
ext_array.sort()
answer.append(ext_array[a[2]-1])
return answer
쉬운문제.