Last active
March 21, 2016 18:02
-
-
Save bcardiff/9ad08d2e217cef7691a6 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
def ej(a, b) | |
size = [a.size, b.size].min | |
a[0...size].zip(b[0...size]) | |
.map { |e| e.max } | |
.map(&.+(4)) | |
.select(&.>=(10)) | |
.sum | |
end | |
ej [1,5,3,4], [5,3,6] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment