Skip to content

Instantly share code, notes, and snippets.

@AdamMescher
Created December 3, 2020 04:34
Show Gist options
  • Save AdamMescher/5644f89fec7d1e03974d2e1af7b32409 to your computer and use it in GitHub Desktop.
Save AdamMescher/5644f89fec7d1e03974d2e1af7b32409 to your computer and use it in GitHub Desktop.
2020 Advent of Code Day 01 Part 2 Solution in JavaScript
for (let i = 0; i < input.length; i++) {
for (let j = 0; j < input.length; j++) {
for (let k = 0; k < input.length; k++) {
if(input[i] + input[j] + input[k] === 2020) {
console.log(`Output: ${input[i] * input[j] * input[k]}`)
break
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment