7 kyu
Highest and Lowest
125,797 of 313,586Deantwo
Description:
In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number.
Examples
highAndLow("1 2 3 4 5"); // return "5 1"
highAndLow("1 2 -3 4 5"); // return "5 -3"
highAndLow("1 9 3 4 -5"); // return "9 -5"
Notes
- All numbers are valid
Int32
, no need to validate them. - There will always be at least one number in the input string.
- Output string must be two numbers separated by a single space, and highest number is first.
Fundamentals
Strings
Similar Kata:
Stats:
Created | May 7, 2015 |
Published | May 7, 2015 |
Warriors Trained | 510836 |
Total Skips | 37285 |
Total Code Submissions | 995006 |
Total Times Completed | 313586 |
C# Completions | 18767 |
JavaScript Completions | 125797 |
Python Completions | 104049 |
Ruby Completions | 9346 |
Java Completions | 29979 |
CoffeeScript Completions | 60 |
Haskell Completions | 1974 |
Rust Completions | 3145 |
TypeScript Completions | 5457 |
F# Completions | 236 |
Go Completions | 4424 |
Kotlin Completions | 2967 |
PHP Completions | 6479 |
Crystal Completions | 49 |
C++ Completions | 6460 |
Elixir Completions | 326 |
Julia Completions | 111 |
R Completions | 259 |
Clojure Completions | 222 |
C Completions | 1228 |
COBOL Completions | 12 |
Scala Completions | 280 |
D Completions | 16 |
Lua Completions | 198 |
Factor Completions | 16 |
Groovy Completions | 17 |
Dart Completions | 140 |
Swift Completions | 118 |
Total Stars | 3534 |
% of votes with a positive feedback rating | 90% of 23853 |
Total "Very Satisfied" Votes | 19609 |
Total "Somewhat Satisfied" Votes | 3878 |
Total "Not Satisfied" Votes | 366 |