Skip to content

Instantly share code, notes, and snippets.

@L8D
Last active December 21, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save L8D/6236756 to your computer and use it in GitHub Desktop.
Save L8D/6236756 to your computer and use it in GitHub Desktop.
def longest_string array
array.sort_by! &:length
max_length = array.last.length
array.reject { |x| x.length < max_length }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment