-
-
Save gabrie30/221bdb643d216677ad56 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
my_array = %w{10 56 93 97 122 92 3 49 588 422 18} | |
highest_number = 0 | |
my_array.each do |number| | |
number = number.to_i | |
highest_number = number if number > highest_number | |
end | |
puts highest_number | |
p my_array.max # => "97" ? i would assome this returns 588 | |
p my_array.min # => "10" ? i would assume this returns 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment