On Jan 9, 2006, at 12:53 PM, Victor Reyes wrote:

> I have two arrays of different sizes.
> Right now via find_all I can find all the elements that are common  
> to both
> arrays.
> All the elements in the smaller arrays can be found in the larger  
> array.
>
> What I would like to find now is all th elements that are in the  
> larger
> array and missing on the smaller array.
> I know I can iterate and compare each element within a nested loop.
> But is there a way to print out the elements that are missing from the
> smaller array without having to implement a nested loop?
>
> Thank you
>
> Victor

Like this?

irb(main):009:0> a = [1,2,3,4,5]
=> [1, 2, 3, 4, 5]
irb(main):010:0> b = [1,2,3]
=> [1, 2, 3]
irb(main):011:0> a - b
=> [4, 5]

Cheers-
-Ezra