From: David Madden Date: 2007-01-16T13:59:57+09:00 Subject: Re: Can anyone try to solve this problems? >> >> def longest(a) >> word = '' >> a.each do |i| >> if word.length < i.length >> word = i >> end >> end >> word >> end > > ['fodfsafdfsdfso','bar','bazzzzzz'].sort_by { |s| s.length }.pop > The beauty of a one line solution :-) also...what is this about: max_by(&:length) Dave.