arr = array[i:j].sort()이런식으로 해주면 오류가나더라.. 그래서 한줄씩 해주도록하자
def solution(array, commands): answer=[] for command in commands: i=command[0]-1 j=command[1] k=command[2]-1 arr=array[i:j] arr.sort() answer.append(arr[k]) return answer