RosettaCodeData/Task/Longest-string-challenge/Ruby/longest-string-challenge-2.rb
2023-07-01 13:44:08 -04:00

2 lines
61 B
Ruby

h = $stdin.group_by(&:size)
puts h.max.last unless h.empty?