Skip to content

Instantly share code, notes, and snippets.

@brysgo
Created May 10, 2013 15:46
Show Gist options
  • Save brysgo/5555285 to your computer and use it in GitHub Desktop.
Save brysgo/5555285 to your computer and use it in GitHub Desktop.
Ruby Array XOR
class Array
def xor(other)
self + other - (self & other)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment