Test cases incorrect

Input:
27
0 2 4 5 10 11 12 37 41 44 46 47 53 54 66 67 68 69 71 77 79 80 81 85 88 89 91
4 7 8 14 19 23 24 28 31 35 36 36 37 45 47 49 55 59 70 72 75 80 81 85 85 90 96

Output:
49

Correct output should be 48.

hi @shabbirchatrissa_c987d33ad497d50c 48 is not even in the arrays, median is middle element and here and that is (n-1) th element in this question

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.

But in case of even number of elements, the median is avg of middle two elements, isn’t it?

5 1 3 5 7 9 2 4 6 8 10

For sample input 1 2 3 4 5 6 7 8 9 10 (merged), why is median 5 and not 6?

For the previous test case nth element (27th) is median. For sample input (n-1)th element (4th) is median. But according to definition of median, for even length of input, median = (a[n-1] + a[n])/2

Any updates on this?

hi @shabbirchatrissa_c987d33ad497d50c the test case here are anyhow faulty, you can try here https://leetcode.com/problems/median-of-two-sorted-arrays/

Yes, I’ve already submitted my code in leetcode. It passes all test cases.

@shabbirchatrissa_c987d33ad497d50c nice then here test cases are faulty so u can leave it

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.