Heaps / Priority QueuesKth Largest Element in Array
Progress
solution.py
⌘↵ run
Loading...

Kth Largest Element in Array

medium
You've got this! Start small, think out loud.

Given an integer array `nums` and an integer `k`, return the kth largest element. Note that it is the kth largest in sorted order, not the kth distinct element.

Time:O(n log k)
Space:O(k)
heaptop-kgoogle-favorite
OUTPUT

Run your code to see output