Median in a stream of running integers

I have written the code that gives the correct output for the given sample testcase on compilation but fails to pass any testcase.
Code:

@GreatCoderboy123
You can use this test case to debug your code
Q : 3
10
305 213 915 543 331 259 751 387 229 949
7
936 928 520 45 465 7 22
10
57 305 415 322 966 255 226 955 210 255

A :
305 259 305 424 331 318 331 359 331 359
936 932 928 724 520 492 465
57 181 305 313 322 313 305 313 305 280

I am not able to understand what is going wrong in my code

ok thanks…I understand it now

1 Like