Retired
Median fun fun (retired)
257 of 780majakudlicka
Description:
Description:
The mean (or average) is the most popular measure of central tendency; however it does not behave very well when the data is skewed (i.e. wages distribution). In such cases, it's better to use the median.
Your task for this kata is to find the median of an array consisting of n elements.
You can assume that all inputs are arrays of numbers in integer format. For the empty array your code should return NaN
(false in JavaScript/NULL
in PHP/nil
in Ruby).
Examples:
Input [1, 2, 3, 4]
--> Median 2.5
Input [3, 4, 1, 2, 5]
--> Median 3
Fundamentals
Arrays
Data Types
Basic Language Features
Mathematics
Algorithms
Logic
Numbers
Similar Kata:
Stats:
Created | Nov 11, 2016 |
Warriors Trained | 1235 |
Total Skips | 44 |
Total Code Submissions | 3719 |
Total Times Completed | 780 |
JavaScript Completions | 257 |
TypeScript Completions | 54 |
Python Completions | 296 |
Ruby Completions | 90 |
Crystal Completions | 5 |
PHP Completions | 118 |
Total Stars | 6 |
% of votes with a positive feedback rating | 92% of 218 |
Total "Very Satisfied" Votes | 186 |
Total "Somewhat Satisfied" Votes | 28 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 8 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |