Skip to content

Instantly share code, notes, and snippets.

@ezaurum
Created February 17, 2022 05:49
Show Gist options
  • Save ezaurum/efa25e0b7882e5320ede24f19d40adf9 to your computer and use it in GitHub Desktop.
Save ezaurum/efa25e0b7882e5320ede24f19d40adf9 to your computer and use it in GitHub Desktop.
const fs = require("fs")
const line = fs.readFileSync("/dev/stdin").toString().split("\n")
const limit = Number(line[0])
console.log(line.slice(1, limit + 1).reduce( (result, l, idx, arr) => {
const [a, b] = l.split(/\s/).map(Number)
return result + (a + b) + "\n"
}, ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment