Find K Top In a Stream

I have written the following solution(as you can see) and it works fine. But I just wanted to confirm if the method I applied was correct or not?

Kindly confirm the same.

Regards,
Ajay Bhat.

yes ,
its completely fine :slight_smile: