RosettaCodeData/Task/Longest-string-challenge/Ruby/longest-string-challenge-2.rb

3 lines
61 B
Ruby
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
h = $stdin.group_by(&:size)
puts h.max.last unless h.empty?