Created
March 22, 2016 17:11
-
-
Save pca2/3bbb4e7c53531d6a5bc5 to your computer and use it in GitHub Desktop.
return smallest integer of an array
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 return_min(array) | |
min = array[0] | |
for i in array | |
if i < min | |
min = i | |
end | |
end | |
return min | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment