Insert and Find Kth Largest
Asked at Google
Reported by the problem's creator, not verified
LargestFinder() starts with no numbers and keeps every number it is given, repeats included.
Examples
Example 1
Input: init =
[], operations =[["insert",[3]],["insert",[3]],["insert",[2]],["find_largest",[0]],["find_largest",[1]],["find_largest",[2]]]Output:
[null,null,null,3,3,2]Explanation: Inserting 3, 3, 2 gives the values 3, 3, 2 in descending order.
find_largest(0)is 3,find_largest(1)is the second 3 because duplicates count, andfind_largest(2)is 2.
Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.