Skip to content

Commit 6453a20

Browse files
committed
[level 1] Title: K번째수, Time: 0.01 ms, Memory: 11.6 MB -BaekjoonHub
1 parent ec9010e commit 6453a20

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
def solution(array, commands):
22
ans = []
3-
for i in range(len(commands)):
4-
if commands[i][0] == commands[i][1]:
5-
ans.append(array[commands[i][0]-1])
6-
else:
7-
ans.append(sorted(array[commands[i][0]-1:commands[i][1]])[commands[i][2]-1])
3+
for com in commands:
4+
ans.append(sorted(array[com[0]-1:com[1]])[com[2]-1])
85
return ans

프로그래머스/1/42748. K번째수/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# [level 1] K번째수 - 42748
22

3-
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/42748?language=java)
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/42748?language=python3)
44

55
### 성능 요약
66

7-
메모리: 75.9 MB, 시간: 1.94 ms
7+
메모리: 11.6 MB, 시간: 0.01 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2026년 06월 27일 15:45:52
19+
2026년 07월 26일 15:37:09
2020

2121
### 문제 설명
2222

0 commit comments

Comments
 (0)