8 kyu

Find Maximum and Minimum Values of a List

11,810 of 156,135Goncalerta

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 Trained208793
Total Skips14427
Total Code Submissions301954
Total Times Completed156135
C++ Completions11810
JavaScript Completions51698
Ruby Completions3604
Python Completions56536
C# Completions7891
PHP Completions4009
Elixir Completions615
CoffeeScript Completions44
Java Completions13907
C Completions4092
TypeScript Completions2550
Crystal Completions21
NASM Completions59
Julia Completions84
R Completions285
COBOL Completions24
Lua Completions273
Haskell Completions302
Rust Completions1718
Scala Completions194
Dart Completions148
Total Stars937
% of votes with a positive feedback rating88% of 9358
Total "Very Satisfied" Votes7458
Total "Somewhat Satisfied" Votes1531
Total "Not Satisfied" Votes369
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