Created
December 18, 2012 15:32
-
-
Save nolan/4328987 to your computer and use it in GitHub Desktop.
Determine the length of the longest string in 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 longest(a) | |
a.map(&:length).max | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment