Amazon | Onsite 2020
Anonymous User
395

I'm not sure what the optimal answer of this was, but it was similar to this one, with K as not constant.
https://leetcode.com/problems/kth-largest-element-in-a-stream/
More specifically, there is a separate method for inputting to the stream, and a separate method to get Kth largest with K as an input.

The interviewer mentioned the inputs can be grouped together if they are similar. Ex, 4,5,6 can be grouped as 3 5's

Comments (0)
No comments yet.