Created
June 19, 2016 20:11
-
-
Save strangelittlemonkey/1bc72bd86f7ad0b3ccd770b8f72bb8f0 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
arr1 = [ 1, 2, 2 ] | |
arr2 = [ 0, 1, 3 ] | |
@arr3 = [] | |
def array_push(arr) | |
arr.each do |element| | |
if ! @arr3.include?(element) | |
@arr3.push(element) | |
end | |
end | |
end | |
array_push arr1 | |
array_push arr2 | |
puts @arr3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment