Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ruby happens to have a built-in method, sample, that selects random values from an array without replacement. Thanks to QPaysTaxes for pointing out that I don't need the parens.
Ruby, 33
p(*[*1..69].sample(5),rand(26)+1)
Ruby happens to have a built-in method, sample, that selects random values from an array without replacement.
Ruby, 33 32
p*[*1..69].sample(5),rand(26)+1
Ruby happens to have a built-in method, sample, that selects random values from an array without replacement. Thanks to QPaysTaxes for pointing out that I don't need the parens.