본문 바로가기
프로그래머스

Level1 K번째 수

by ysunee 2022. 2. 2.
def solution(array, commands):
    answer = []
    n = len(commands)
    
    for i in range(n):
        a = commands[i][0]
        b = commands[i][1]
        c = commands[i][2]
        arr = array[a-1:b]
        arr.sort()
        
        answer.append(arr[c-1])
    return answer

'프로그래머스' 카테고리의 다른 글

Level1 체육복  (0) 2022.02.02
Level1 모의고사  (0) 2022.02.02
Level1 소수 만들기  (0) 2022.02.02
Level1 내적  (0) 2022.02.02
Level1 음양 더하기  (0) 2022.02.02

댓글