Created
December 2, 2017 08:33
-
-
Save ryanberry/5abfa756c45c9afe4b77a4280d75699c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let table = data.split(/\r?\n/).map(line => line.split(/\t/).map(Number)) | |
let checkSum = table.reduce( | |
(prev, line) => (prev += Math.max(...line) - Math.min(...line)), | |
0, | |
) | |
console.log(checkSum) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment