On 2/4/06, Dave Howell <groups / grandfenwick.net> wrote:> I mean, this seems so, er, obvious! "Please find one instance of this> object in the array, and return to me the array without that object. If> the array doesn't have that object, then just give the array back to> me."
  class Array    def without_one(elem)      new = self.dup # make a copy so that the original is not changed      new.delete_at(new.index(elem))      new    end  end
  [1,2,3,4,4,4,5,5].without_one(4) #=> [1,2,3,4,4,5,5]
-Levin