LessonΒ·difficulty 2/5Β·~15 min
Summarize request latency
Implement median_latency(values).
values is a list of non-negative finite latency measurements. Return the median, averaging the middle pair for even counts. Empty input returns None. Do not change the input order.
Before coding, predict one result by hand. After the tests pass, explain your approach and add a boundary example of your own.
Tests
- Case 1
- Case 2
- Case 3
- Case 4
- Preserves input
β¦ Stuck? Ask for a spark
Sign in or create a free account to use your monthly AI explainer allowance.
warming up
Loading editorβ¦
Consolewaiting
$ Console output will appear here.