Why is it important for m <=n in the solution ?
Why is it important for m <=n
sharvin2187
#2
because there can be a case such that answer does not exist in array1.
example
A: 1,2 n=2
B: 5,6,7,8,9 m=5
answer is 6, but if you search for median in A you will never find it.
It is not. You can also enforce appropriate imin and imax such that ājā always stays in the bounds of the array.
Here is the code.