Reading the test cases
Reading the test cases, I understand that your definition of the medium should be: - If the length is odd: A number of the list that can separate the upper half from the lower half - If the length is even: The average between the utmost of the lower half and the smallest of the upper half
My definition might not be clearer but you may mix yours and mine...