From: Josh Cheek Date: 2010-02-08T15:44:32+09:00 Subject: Re: Combinatorics and permutations? Help? --000e0cd139102b34b7047f112237 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Feb 7, 2010 at 9:29 PM, Sergio Bayona wrote: > I have a similar challenge: > > given: [{"a" => [1, 2]}, {"b" => [3, 4]}] > > I need: [{"a" => 1, "b" => 3}, {"a" => 1, "b" => 4}, {"a" => 2, "b" => > 3}, {"a" => 2, "b" => 4}] > > Any ideas? > > Thanks. > S > -- > Posted via http://www.ruby-forum.com/. > > Here is a solution I have come up with (http://gist.github.com/297937). I don't know how you want all edge cases to be handled, I made my best guesses, you can see them in the tests. --000e0cd139102b34b7047f112237--