Move to subdirectory

This commit is contained in:
Sven Weidauer 2022-11-23 16:34:31 +01:00
parent c4ae807a5f
commit c7deb3c71d
47 changed files with 1208 additions and 0 deletions
2020/day1

21
2020/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)
}
}
}
}