这题是求出来排序好的数的第k个大的数。用了.sort()之后就非常简单了。不用自己排序的表示真是简单啊。然而真讲排序我还基本不会。。。代码如下:
class Solution(object):
def findKthLargest(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: int
"""
nums.sort()
nums = nums[::-1]
return nums[k - 1]