From: "Jan E." Date: 2012-09-07T03:11:06+09:00 Subject: Re: Subtraction, union and intersection of arrays in Ruby Hi, So you're not even allowed to use basic methods like Array#include? In this case you'll need a nested iterator to check for every element if it's in the subtracted array. However, I refuse to use a "for" loop, because it's merely the evil twin of the "each" method and is in no way more "basic". Ruby isn't C. So the code would look something like this: result = [] op_sys.each do |op| add_element = true linux_sys.each do |linux| if op == linux add_element = false break end end result << op if add_element end Your own solution I don't understand. It seems you have some difficulties with the programming logic and Ruby syntax. -- Posted via http://www.ruby-forum.com/.