Last active
December 1, 2020 20:37
-
-
Save felix-larsen/dc1d1f15fd8d019903a6c5f2bac58735 to your computer and use it in GitHub Desktop.
1st December - Advent of Code 2020
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
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])") | |
} | |
} | |
} |
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
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