def solution(array, commands):
answer = []
for i in commands:
selec_lst = array[i[0]-1: i[1]]
selec_lst.sort()
answer.append(selec_lst[i[2]-1])
return answer
본받을 소스
def solution(array, commands):
return list(map(lambda x:sorted(array[x[0]-1:x[1]])[x[2]-1], commands))
'프로그래밍 > 코딩테스트' 카테고리의 다른 글
[BOJ] 1920 수 찾기(이분탐색) (0) | 2022.07.19 |
---|---|
[프로그래머스] SQL lv2 ) 중성화 여부 파악하기 MySQL (0) | 2022.07.18 |
[프로그래머스] 신고 결과 받기 (0) | 2022.07.17 |
[PLAN]220711 - 220715 구현, 문자열 BOJ + DP (0) | 2022.07.11 |
[프로그래머스] 1단계 완전탐색 모의고사 python (0) | 2022.06.20 |