7 kyu
Highest and Lowest
126,614 of 316,207Deantwo
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 | 514477 |
Total Skips | 37475 |
Total Code Submissions | 1001011 |
Total Times Completed | 316207 |
C# Completions | 18877 |
JavaScript Completions | 126614 |
Python Completions | 105193 |
Ruby Completions | 9379 |
Java Completions | 30189 |
CoffeeScript Completions | 60 |
Haskell Completions | 1983 |
Rust Completions | 3170 |
TypeScript Completions | 5540 |
F# Completions | 238 |
Go Completions | 4483 |
Kotlin Completions | 2991 |
PHP Completions | 6531 |
Crystal Completions | 49 |
C++ Completions | 6538 |
Elixir Completions | 327 |
Julia Completions | 111 |
R Completions | 261 |
Clojure Completions | 227 |
C Completions | 1255 |
COBOL Completions | 12 |
Scala Completions | 283 |
D Completions | 16 |
Lua Completions | 203 |
Factor Completions | 17 |
Groovy Completions | 17 |
Dart Completions | 155 |
Swift Completions | 132 |
Total Stars | 3548 |
% of votes with a positive feedback rating | 90% of 23926 |
Total "Very Satisfied" Votes | 19672 |
Total "Somewhat Satisfied" Votes | 3887 |
Total "Not Satisfied" Votes | 367 |