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
Similar Kata:
Stats:
Created | Jul 4, 2016 |
Published | Jul 4, 2016 |
Warriors Trained | 214115 |
Total Skips | 14764 |
Total Code Submissions | 309040 |
Total Times Completed | 160263 |
C++ Completions | 12339 |
JavaScript Completions | 52640 |
Ruby Completions | 3631 |
Python Completions | 58308 |
C# Completions | 8080 |
PHP Completions | 4074 |
Elixir Completions | 623 |
CoffeeScript Completions | 45 |
Java Completions | 14260 |
C Completions | 4207 |
TypeScript Completions | 2636 |
Crystal Completions | 23 |
NASM Completions | 60 |
Julia Completions | 85 |
R Completions | 294 |
COBOL Completions | 25 |
Lua Completions | 290 |
Haskell Completions | 314 |
Rust Completions | 1775 |
Scala Completions | 201 |
Dart Completions | 197 |
Total Stars | 953 |
% of votes with a positive feedback rating | 88% of 9456 |
Total "Very Satisfied" Votes | 7538 |
Total "Somewhat Satisfied" Votes | 1544 |
Total "Not Satisfied" Votes | 374 |
Total Rank Assessments | 9 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |