I have to find intersection elements of 3 integer arrays
say a, b, c with a condition; if any of the array is null ( [] ),
simply ignore the array and find intersection of the remaining arrays,
and if all three are null, then return [].
Thanks in advance.
ps:Ruby 1.9.3
One way to do it would be this:
Other options suggested in the discussion are:
and:
But in this last case, beware of non-empty arrays with explicit nil elements, such as
[ nil ], cause they still fail #any? test.