mycode  77.39%

class Solution(object):
    def findKthLargest(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: int
        """
        nums.sort()
        return nums[-k]

 

参考

class Solution(object):
    def findKthLargest(self, nums, k):
        nums.sort(reverse=True)
        return nums[k-1]

 

相关文章:

  • 2022-12-23
  • 2021-04-29
  • 2022-01-03
  • 2022-03-06
猜你喜欢
  • 2021-05-04
  • 2021-04-29
  • 2021-10-09
  • 2021-08-03
  • 2021-09-12
  • 2021-07-03
  • 2022-12-23
相关资源
相似解决方案