알고리즘 with python/20240909
프로그래머스 K번째수 with Python
정민됴
2024. 9. 12. 17:55
https://school.programmers.co.kr/learn/courses/30/lessons/42748
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
문제 그대로 작성하면 풀리는 문제였다.
def solution(array, commands):
answer = []
for l in commands:
arr = sorted(array[l[0]-1:l[1]])
answer.append(arr[l[2]-1])
return answer