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
Similar Kata:
Stats:
Created | Jul 4, 2016 |
Published | Jul 4, 2016 |
Warriors Trained | 208793 |
Total Skips | 14427 |
Total Code Submissions | 301954 |
Total Times Completed | 156135 |
C++ Completions | 11810 |
JavaScript Completions | 51698 |
Ruby Completions | 3604 |
Python Completions | 56536 |
C# Completions | 7891 |
PHP Completions | 4009 |
Elixir Completions | 615 |
CoffeeScript Completions | 44 |
Java Completions | 13907 |
C Completions | 4092 |
TypeScript Completions | 2550 |
Crystal Completions | 21 |
NASM Completions | 59 |
Julia Completions | 84 |
R Completions | 285 |
COBOL Completions | 24 |
Lua Completions | 273 |
Haskell Completions | 302 |
Rust Completions | 1718 |
Scala Completions | 194 |
Dart Completions | 148 |
Total Stars | 937 |
% of votes with a positive feedback rating | 88% of 9358 |
Total "Very Satisfied" Votes | 7458 |
Total "Somewhat Satisfied" Votes | 1531 |
Total "Not Satisfied" Votes | 369 |
Total Rank Assessments | 9 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |