Please tell me what’s wrong in the code. There is only one test case but it’s showing wrong answer.
Top K most frequent number in a stream
You are not emptying the heap after each test case.
Cross verify with this
Got it, well I didn’t think that way
.Thank you so much for sharing the code 