id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

median


Return the median in an array of three or more (odd number) integers. The median is defined as the middle element that there are as many elements below it as those above it.


median([2, 1, 3, -2, 8]) → 2
median([-4, 6, 2]) → 2
median([4, 2, 48, 1, 50]) → 4

...Save, Compile, Run (ctrl-enter)

public int median(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 300

Copyright Nick Parlante 2017 - privacy