Median in stream of running integers

I am getting correct result for sample input. But all testcases are failing.