Last active
December 31, 2015 19:29
-
-
Save fenixbrassi/8033869 to your computer and use it in GitHub Desktop.
String practice
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
#strings practice | |
def longest_strings( param , n ) | |
param.split(' ').sort_by(&:length).reverse.first(3) | |
end | |
puts "Give me the string" | |
words = gets.chomp | |
puts "\n" | |
puts "The 3 longest string are: #{ longest_strings(words,3)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment