top of page

정렬 코딩테스트 문제 - 프로그래머스

  • Writer: Seunghye Baek
    Seunghye Baek
  • Dec 6, 2021
  • 1 min read

1) array = [i, j, k]

2) i부터 j 까지 list로 숫자 넣기

3) 작은 수부터 sorted 하기 k 번째 숫자 return

def solution(array, commands):
    answer = []
    for c in commands: 
        L = array[c[0]-1 : c[1]]
        L = sorted(L)
        answer.append(L[c[2]-1])
        
    return answer






Comments


Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2020 by Seunghye Baek. Proudly created with Wix.com

bottom of page