Created
June 3, 2016 21:02
-
-
Save Opus1no2/1ede140bc281d3a9640e7c8ec8528a08 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
input = ARGF.read.split(/\n/)[1].split.map { |v| v.to_i }.sort | |
p input[-2, 2].inject { |sum, n| sum.to_i * n.to_i } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment