Median in a stream of running int , the code is wrking fine for a single test case but i am not able to reset my priority queues after every test case , i want to know how i can do that

hello @rohansrivastav

u r doing it correctly.
instead of using float for avg use int and then try.

no its not working , priority queue is still using the previous test case values

ok then define pq inside ur while loop

did that also , still not working

pls share ur updated code , i will check

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.