Created
January 7, 2016 10:23
-
-
Save krokrob/303328cb9afbff8375c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
def highlow(array) | |
min = array[0] | |
max = array[0] | |
for number in array | |
if number < min | |
min = number | |
end | |
if number > max | |
max = number | |
end | |
end | |
resultat = [min, max] | |
end | |
p highlow([24, 34, 56, 135, 3]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment