문제 링크입니다: https://programmers.co.kr/learn/courses/33/lessons/1864
COS Pro 2급 Python 모의고사 - k번째로 작은 수
[[5,12,4,31],[24,13,11,2],[43,44,19,26],[33,65,20,21]] 4 11
programmers.co.kr
회사에서 COS Pro 1급을 따면 상금을 준다고 해서 재미로 2급까지 풀어봤습니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(arr, k): | |
temp = [] | |
for i in range(len(arr)): | |
for j in range(len(arr[0])): | |
temp.append(arr[i][j]) | |
temp.sort() | |
return temp[k - 1] |

개발환경: Programmers IDE
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'Python > COS Pro 2급 Python 모의고사' 카테고리의 다른 글
[Programmers] 거스름돈 (0) | 2022.05.12 |
---|---|
[Programmers] 이름에 "j" 또는 "k"가 들어가는 사람 (0) | 2022.05.12 |
[Programmers] 알파벳 바꾸기 (0) | 2022.05.12 |
[Programmers] 키가 K보다 큰 사람 (0) | 2022.05.12 |
[Programmers] 개구리 (0) | 2022.05.12 |