RosettaCodeData/Task/Executable-library/Sidef/executable-library-3.sidef

8 lines
215 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
include Hailstone
 
var score = Hash()
100_000.times { |i| score{ Hailstone::hailstone(i).len } := 0 ++ }
 
var k = score.keys.max_by {|k| score{k} }
say "Most common length is #{k}, occurring #{score{k}} times"