Created
June 6, 2012 04:41
-
-
Save dominicpacquing/2879953 to your computer and use it in GitHub Desktop.
Array identify new content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.class_eval do | |
def xy(arr2) | |
arr1 = self.dup | |
arr1, arr2 = arr2, arr1 if (arr1 <=> arr2) == 1 | |
(arr1 + arr2) - (arr1) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1