Switched dequeue popping around

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

View File

@ -44,8 +44,7 @@ struct Day10: Runnable {
}
if !isIllegalLine {
var lineScore = 0
s.reverse()
while let last = s.popLast() {
while let last = s.popFirst() {
let charValue = last.closedBy!.autocompleteScore!
lineScore = lineScore * 5 + charValue
}