8 kyu

Find Maximum and Minimum Values of a List

12,339 of 160,263Goncalerta

Description:

Your task is to make two functions ( max and min, or maximum and minimum, etc., depending on the language ) that receive a list of integers as input, and return the largest and lowest number in that list, respectively. Each function returns one number.

Examples (Input -> Output)

* [4,6,2,1,9,63,-134,566]         -> max = 566, min = -134
* [-52, 56, 30, 29, -54, 0, -110] -> min = -110, max = 56
* [42, 54, 65, 87, 0]             -> min = 0, max = 87
* [5]                             -> min = 5, max = 5

Notes

  • You may consider that there will not be any empty arrays/vectors.
Fundamentals

More By Author:

Check out these other kata created by Goncalerta

Stats:

CreatedJul 4, 2016
PublishedJul 4, 2016
Warriors Trained214115
Total Skips14764
Total Code Submissions309040
Total Times Completed160263
C++ Completions12339
JavaScript Completions52640
Ruby Completions3631
Python Completions58308
C# Completions8080
PHP Completions4074
Elixir Completions623
CoffeeScript Completions45
Java Completions14260
C Completions4207
TypeScript Completions2636
Crystal Completions23
NASM Completions60
Julia Completions85
R Completions294
COBOL Completions25
Lua Completions290
Haskell Completions314
Rust Completions1775
Scala Completions201
Dart Completions197
Total Stars953
% of votes with a positive feedback rating88% of 9456
Total "Very Satisfied" Votes7538
Total "Somewhat Satisfied" Votes1544
Total "Not Satisfied" Votes374
Total Rank Assessments9
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Goncalerta Avatar
  • jhoffner Avatar
  • smepple Avatar
  • hencethus Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • Aisenstein Avatar
  • brunolm Avatar
  • smile67 Avatar
  • 10XL Avatar
  • donaldsebleung Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • user5036852 Avatar
  • JohanWiltink Avatar
  • metagn Avatar
  • FArekkusu Avatar
  • monadius Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • stellartux Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • dfhwze Avatar
  • quadratz Avatar
  • KayleighWasTaken Avatar
Ad