Skip to content

Instantly share code, notes, and snippets.

@lifo
Created August 6, 2009 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifo/163283 to your computer and use it in GitHub Desktop.
Save lifo/163283 to your computer and use it in GitHub Desktop.
def eq?(x, y)
x = x.dup
y = y.dup
deleted = []
x.each_with_index do |e, i|
if y.include?(e)
deleted << e
y.delete_at(y.index(e))
end
end
(x - deleted).empty? && y.empty?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment