Stack Bash - Master data structures and algorithms

Kth largest in an array

Medium
Given 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. 1.Merge intervalsMedium
  2. 2.Kth largest in arrayMedium
  3. 3.Intersection of ArraysMedium
  4. 4.Search sorted matrixHard
  5. 5.Search row & col sorted matrixHard

Want to confidently pass your next coding interview?

Stack Bash helps new and veteran software engineers master data structures and algorithms for technical interviews.