I would like the following hash output:
{ 0 => [0,1,2], 1 => [0,1,2], 2 => [0,1,2],
3 => [3,4,5], 4 => [3,4,5], 5 => [3,4,5],
6 => [6,7,8], 7 => [6,7,8], 8 => [6,7,8]
}
Intuitively I can just hard code these values in, but I am struggle to figure out how I can dynamically assign each hash key to the appropriate array value.. For instance perhaps creating a 9.times loop?
{ 0 => (0..2).to_a, 1 => (0..2).to_a, 2 => (0..2).to_a,
3 => (3..5).to_a, 4 => (3..5).to_a, 5 => (3..5).to_a,
6 => (6..8).to_a, 7 => (6..8).to_a, 8 => (6..8).to_a
}
Thanks for any guidance