#
# @lc app=leetcode.cn id=215 lang=python
#
# [215] 数组中的第K个最大元素
#
# @lc code=start
class Solution(object):
def findKthLargest(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: int
"""
n = sorted(nums)
# nums.sort()
return n[len(n) - k]
215.数组中的第k个最大元素
最新推荐文章于 2024-07-20 09:51:47 发布