I just discovered two different ways to create a fixed-length array filled with a default value.
Array.new(5,1) # => [1,1,1,1,1] [1] * 5 # => [1,1,1,1,1]
I just discovered two different ways to create a fixed-length array filled with a default value.
Array.new(5,1) # => [1,1,1,1,1] [1] * 5 # => [1,1,1,1,1]