From: Robert Klemme Date: 2009-08-25T02:15:07+09:00 Subject: Re: INNER JOINING Two Arrays On 24.08.2009 18:22, Dan wrote: > Q2: Are there any observations one could make about which scenario > would be faster both for my code and a more idiomatic solution you > might have? Your algorithm has effort O(n*m) while with the given preconditions you should be able to achieve O(n+m) instead. Less formal speaking, your version compares each possible pair (all combinations, hence n*m) while more efficient approaches exist. Hint (because this seems to be some kind of assignment): you cannot use Ruby's iteration via #each but should use array indexes. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/