145: Kth largest element in an array

Given an unsorted array of integers, return Kth largest element in the given array

Note: 1 ≤ k ≤ array's length

 

Example 1

Input:   array = [1, 4, 3, 2, 4], k = 2

Output:  4

Example 2

Input:   array = [4, 3, 6, 7, 1, 2, 7], k = 7

Output:  1
Difficulty:Medium
Topic:Sorting
Problem #:145