actually the output should be a float but I am printing its integer part. and the answer is showing correct when i submitted. and it is not given in the question to print the integral value of a number since the array size is same , the median can be a float when atleast one number in the calculation of average is odd…please clarify…
Doubt in question
@Bond007 it is clear from the sample input that if 2 medians are there (in case of even number of total elements) then you can choose the smaller one, and if 1 median is there(odd no of elements) then there’s no confusion in the first place.
it is not mentioned to consider the smallest median anywhere ?
@Bond007 that is merely my observation from the sample input. It could also be allowed to choose any one of the two medians, i am not sure. but one thing is clear, it cannot be a float because you dont have to report the average of the 2 medians.
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.