1
2
3
4
5
6
7
|
def sol(nums,k):
nums.sort(reverse=True)
print(nums[k - 1])
n,k=map(int, input().split())
nums=list(map(int, input().split()))
sol(nums,k)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2303. Calculate Amount Paid in Taxes (0) | 2022.07.07 |
---|---|
leetcode 1945. Sum of Digits of String After Convert (0) | 2022.07.07 |
leetcode 2236. Root Equals Sum of Children (0) | 2022.07.07 |
leetcode 128. Longest Consecutive Sequence (0) | 2022.07.06 |
leetcode 509. Fibonacci Number (0) | 2022.07.06 |
댓글