Cleaned up
This commit is contained in:
parent
d751bc64f8
commit
984ae73600
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user