8 kyu
Sum without highest and lowest number
5,594 of 104,242user5036852
Description:
Task
Sum all the numbers of a given array ( cq. list ), except the highest and the lowest element ( by value, not by index! ).
The highest or lowest element respectively is a single element at each edge, even if there are more than one with the same value.
Mind the input validation.
Example
{ 6, 2, 1, 8, 10 } => 16
{ 1, 1, 11, 2, 3 } => 6
Input validation
If an empty value ( null
, None
, Nothing
, nil
etc. ) is given instead of an array, or the given array is an empty list or a list with only 1
element, return 0
.
Fundamentals
Similar Kata:
Stats:
Created | Jun 23, 2016 |
Published | Jun 23, 2016 |
Warriors Trained | 184351 |
Total Skips | 18801 |
Total Code Submissions | 588660 |
Total Times Completed | 104242 |
C# Completions | 5594 |
JavaScript Completions | 34874 |
Python Completions | 35785 |
CoffeeScript Completions | 39 |
Ruby Completions | 2751 |
PHP Completions | 3304 |
C++ Completions | 8260 |
Java Completions | 10110 |
F# Completions | 187 |
C Completions | 2808 |
TypeScript Completions | 1921 |
Haskell Completions | 742 |
Objective-C Completions | 98 |
Crystal Completions | 19 |
Julia Completions | 56 |
Factor Completions | 23 |
Nim Completions | 14 |
Dart Completions | 95 |
Lua Completions | 36 |
Total Stars | 1555 |
% of votes with a positive feedback rating | 88% of 8330 |
Total "Very Satisfied" Votes | 6668 |
Total "Somewhat Satisfied" Votes | 1375 |
Total "Not Satisfied" Votes | 287 |