Initial commit

This commit is contained in:
Sven Weidauer 2020-12-11 22:25:14 +01:00
commit dae7c34265
17 changed files with 2001 additions and 0 deletions

21
day1/main.swift Normal file
View file

@ -0,0 +1,21 @@
import Foundation
let input = Scanner(string: loadData(day: 1)).integers()!
for i in 0..<input.count {
for j in i..<input.count {
for k in j..<input.count {
let a = input[i]
let b = input[j]
let c = input[k]
if k == j && a + b == 2020 {
print("1st", a * b)
}
if a + b + c == 2020 {
print("2nd", a * b * c)
}
}
}
}