Link: https://leetcode.com/problems/kth-largest-element-in-an-array/
Solution:
Topics: heap
Intuition
Very simple and classic Kth largest/smallest problem. Simply add every number to a min heap and pop off the top when the size of the heap is greater than k
. Return the top of the heap at the end of the loop.
Implementation