From: "Sébastien M." Date: 2011-12-12T02:08:27+09:00 Subject: Re: Removing a multiple array layer Sorry Xas away for a fex days; my input array is ranges = [ [['a', 'b'], ['c', 'd']], [['e', 'f'], ['g', 'h']], [['i', 'j'], ['k', 'l']] ] and i wish to get [ [["a", "b"], ["e", "f"], ["i", "j"]], [["a", "b"], ["e", "f"], ["k", "l"]], [["a", "b"], ["g", "h"], ["i", "j"]], [["a", "b"], ["g", "h"], ["k", "l"]], [["c", "d"], ["e", "f"], ["i", "j"]], [["c", "d"], ["e", "f"], ["k", "l"]], [["c", "d"], ["g", "h"], ["i", "j"]], [["c", "d"], ["g", "h"], ["k", "l"]], ] wich is actually the product, all combination possibles of the various 'ranges' but when i run it through a Array#product i get an added array level whish i would like to remove. reminder here is the method def calculate ranges prod = ranges.shift ranges.each { |r| prod = prod.product(r) } puts prod.to_s end -- Posted via http://www.ruby-forum.com/.