Design a class that tracks the kth largest element in a stream of numbers. It is created with k and an initial array, and add(val) inserts a value and returns the current kth largest.
Practise this challenge
All coding challenges