8 kyu
Find Maximum and Minimum Values of a List
12,207 of 159,311Goncalerta
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 | 212841 |
Total Skips | 14681 |
Total Code Submissions | 307509 |
Total Times Completed | 159311 |
C++ Completions | 12207 |
JavaScript Completions | 52457 |
Ruby Completions | 3624 |
Python Completions | 57885 |
C# Completions | 8035 |
PHP Completions | 4065 |
Elixir Completions | 622 |
CoffeeScript Completions | 45 |
Java Completions | 14167 |
C Completions | 4182 |
TypeScript Completions | 2613 |
Crystal Completions | 23 |
NASM Completions | 59 |
Julia Completions | 85 |
R Completions | 293 |
COBOL Completions | 25 |
Lua Completions | 288 |
Haskell Completions | 313 |
Rust Completions | 1761 |
Scala Completions | 200 |
Dart Completions | 185 |
Total Stars | 951 |
% of votes with a positive feedback rating | 88% of 9436 |
Total "Very Satisfied" Votes | 7522 |
Total "Somewhat Satisfied" Votes | 1540 |
Total "Not Satisfied" Votes | 374 |
Total Rank Assessments | 9 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |