Hi
i have a 3 arrays(A,B,C) which are results of some analysis.
Array A has all members such that array B and C are actually subsets of
A. The order of elements in array A is important.

What i want is to list all members of A such that if an element in A is
a found in B or C produce a report such as

element1 -b
element2 -b
element3 -c
element4 -b
....

where the order of elements in the report is as was in array A.


my rather silly implentation was
A.each do |element|
 if B.detect(element)
    puts "#{element}- b"
  end
end

however i don't think this is the right way to do it since it does not
give me the designed result. Can someone help me spot the bug?

Thank you
George
-- 
Posted via http://www.ruby-forum.com/.