Skip to content

Commit

Permalink
Create Week2_HW1
Browse files Browse the repository at this point in the history
  • Loading branch information
jadely-lab authored Apr 3, 2022
1 parent 90482d1 commit 4f4cdd7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Week2_HW1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//220403
//프로그래머스 코딩테스트 연습 K번째수
//https://programmers.co.kr/learn/courses/30/lessons/42748

def solution(array, commands):
answer = []
for a in range(len(commands)):
i = commands[a][0]
j = commands[a][1]
k = commands[a][2]

new = array[i-1:j]
new.sort()
output = new[k-1]
answer.append(output)
new = []

return answer

0 comments on commit 4f4cdd7

Please sign in to comment.