You need to understand that Homeworks are given for a reason. And the primary reason is to prepare you for real-world job tasks.
Apart from that, you don't even care to google the question, otherwise, you have had found the solution like below in less than a minute.
K'th largest element in a stream - GeeksforGeeks[
^]
You have to understand that there is no shortcut of Success.