This is what I have so far:
myArray.map!{ rand(max) }
Obviously, however, sometimes the numbers in the list are not unique. How can I mak
No loops with this method
Array.new(size) { rand(max) } require 'benchmark' max = 1000000 size = 5 Benchmark.realtime do Array.new(size) { rand(max) } end => 1.9114e-05