Python--3 lines--52ms


  • -2
    S
    class Solution(object):
        def findKthLargest(self, nums, k):
            """
            :type nums: List[int]
            :type k: int
            :rtype: int
            """
            m = sorted(nums)
            
            kth = m[len(m)-k]
            
            return kth

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.