Skip to main content
Kth Largest Element in a Stream | AlgoCracked
AlgoCracked
ProblemsKth Largest Element in a Stream
Easy55.0% acceptance
Blind75TreeDesignBinary Search TreeHeap

Kth Largest Element in a Stream

Design a class that reports the k-th largest element seen in a stream (not the k-th distinct). add(val) returns the k-th largest after inserting val . KthLargest(k, nums) constructs it with an initial list. Input format Operation names + parallel argument lists.

Loading workspace…