Design a class that tracks the k-th largest element in a stream of test scores.
Input: one operation per line —
init k v1 v2 … — first line: initialize with k and the initial values (possibly none)add x — add a score and print the current k-th largestOutput: init prints null; each add prints the k-th largest after insertion. There are always at least k values when add is called.
init 3 4 5 8 2 add 3 add 5 add 10 add 9 add 4
null 4 5 5 8 8
Run your code against the sample tests, or Submit to run the full suite.