Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 441 Bytes

kth-largest-element-in-an-array-2.md

File metadata and controls

17 lines (14 loc) · 441 Bytes
"""
  Problem Name : Kth Largest Element in an Array
  Problem URL : https://leetcode.com/problems/kth-largest-element-in-an-array/
  Description :
    Given an integer array nums and an integer k, return the kth largest element in the array.
    
  Difficulty : Medium
  Language : Python3
  Category : Algorithms
"""
class Solution:
    def findKthLargest(self, nums: List[int], k: int) -> int:
        return sorted(nums)[-k]