프로그래머스 k번째 수
def solution(array, commands): result=[] for command in commands: arr = array arr=arr[command[0]-1:command[1]] arr.sort() result.append(arr[command[2]-1]) return result print(solution([1, 5, 2, 6, 3, 7, 4],[[2, 5, 3],[4, 4, 1], [1, 7, 3]])) https://programmers.co.kr/learn/courses/30/lessons/42748