I was wondering how can I generate the next array using ranges in ruby
["00","00","01","01","02", "02", ...... "10", "10"]
I want to repeat each element twice, the part I'm looking for an answer to. I can create individual elements below
("00".."10").to_a
I know I can do this with loops, etc., but I'm looking for simpler, single line code
thanks
source share