All problems

Median API Response Time

easyPythonDescriptive Statistics

It is 3 a.m. and you are on call at Whetcode Cloud. The dashboard has gone amber: it reports an average response time of nearly 30 ms on the checkout endpoint, well over the internal target. Yet every individual request you click into looks fast. Before you wake the platform lead you want a summary of the same requests that one freak response cannot move.

You will be running this against whatever window of the log you pull, so the count and the ordering are whatever the log hands you - the times arrive in the order the requests happened, not in size order.

Task: Print the median response time. The count is always odd, so the answer is one of the values supplied - print it exactly as it stands, with no rounding and no conversion.

Input

One line holding the response times in milliseconds, separated by single spaces, in the order they were logged. Every time is a whole number, and there is always an odd number of them.

Output

One line holding the median, printed as the whole number of milliseconds it is - 15, never 15.0.

Example:

Input:
100 42 23 12 8 4 15

Output:
15

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…