Cleaned up

This commit is contained in:
Max Nuding 2021-12-10 07:40:47 +01:00
parent d751bc64f8
commit 984ae73600
Signed by: phlaym
GPG Key ID: A06651BAB6777237

View File

@ -9,6 +9,7 @@ import Foundation
import Runner
import Collections
struct Day10: Runnable {
let inputPath: String
@ -17,11 +18,10 @@ struct Day10: Runnable {
let lines = input
.trimmingCharacters(in: .newlines)
.components(separatedBy: .newlines)
//.map { line in line.map { $0.wholeNumberValue! } }
var s = Deque<String.Element>()
var illegalCharacters = [String.Element]()
var autocompleteScores = [Int]()
for (lineNumber, line) in lines.enumerated() {
for line in lines {
s = Deque<String.Element>()
var isIllegalLine = false
for char in line {
@ -55,8 +55,6 @@ struct Day10: Runnable {
print(illegalCharacters.map{$0.score!}.reduce(0,+))
print(autocompleteScores.sorted()[autocompleteScores.count / 2])
}
}
extension String.Element {