Kth largest in an array
MediumGiven an unsorted array of numbers, find the
kth
largest element.For example, if
k = 3
with the following input array:A = [5, 3, 7, 0, 6]
Your function should return
5
since its the largest number after 7
and 6
.Solution
5 Essential Sorting & Searching Coding Interview Problems
Master Sorting & Searching by trying the coding challenges below.
- 1.Merge intervalsMedium
- 2.Kth largest in arrayMedium
- 3.Intersection of ArraysMedium
- 4.Search sorted matrixHard
- 5.Search row & col sorted matrixHard