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

Stats:

CreatedJun 23, 2016
PublishedJun 23, 2016
Warriors Trained184351
Total Skips18801
Total Code Submissions588660
Total Times Completed104242
C# Completions5594
JavaScript Completions34874
Python Completions35785
CoffeeScript Completions39
Ruby Completions2751
PHP Completions3304
C++ Completions8260
Java Completions10110
F# Completions187
C Completions2808
TypeScript Completions1921
Haskell Completions742
Objective-C Completions98
Crystal Completions19
Julia Completions56
Factor Completions23
Nim Completions14
Dart Completions95
Lua Completions36
Total Stars1555
% of votes with a positive feedback rating88% of 8330
Total "Very Satisfied" Votes6668
Total "Somewhat Satisfied" Votes1375
Total "Not Satisfied" Votes287
Ad
Contributors
  • user5036852 Avatar
  • jhoffner Avatar
  • smepple Avatar
  • GiacomoSorbi Avatar
  • suic Avatar
  • Dentzil Avatar
  • JohanWiltink Avatar
  • asedov Avatar
  • Voile Avatar
  • FArekkusu Avatar
  • monadius Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • tri@ Avatar
  • quadratz Avatar
  • KayleighWasTaken Avatar
  • metatable Avatar
  • Gabrioche Avatar
Ad