C++ Solution to Coding Challenge 703. Kth Largest Element in a Stream

An example of using std::priority_queue

Nhut Nguyen
LeetSolve
Published in
3 min readFeb 20, 2023

--

Problem statement

Design a class to find the k-th largest element in a stream. Note that it is the k-th largest element in the sorted order, not the k-th distinct element.

--

--