Skip to content

Instantly share code, notes, and snippets.

@felix-larsen
Last active December 1, 2020 20:37
Show Gist options
  • Save felix-larsen/dc1d1f15fd8d019903a6c5f2bac58735 to your computer and use it in GitHub Desktop.
Save felix-larsen/dc1d1f15fd8d019903a6c5f2bac58735 to your computer and use it in GitHub Desktop.
1st December - Advent of Code 2020
for i in 0...data.count-1 {
for a in i...data.count-1 {
if(data[i] + data[a] == 2020) {
print("Result \(data[i] * data[a])")
}
}
}
for i in 0...data.count-1 {
for a in i...data.count-1 {
for b in a...data.count-1 {
if(data[i] + data[a] + data[b] == 2020) {
print("Result \(data[i] * data[a] * data[b])")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment