Switched dequeue popping around
This commit is contained in:
parent
984ae73600
commit
ec5a7feb3f
@ -44,8 +44,7 @@ struct Day10: Runnable {
|
|||||||
}
|
}
|
||||||
if !isIllegalLine {
|
if !isIllegalLine {
|
||||||
var lineScore = 0
|
var lineScore = 0
|
||||||
s.reverse()
|
while let last = s.popFirst() {
|
||||||
while let last = s.popLast() {
|
|
||||||
let charValue = last.closedBy!.autocompleteScore!
|
let charValue = last.closedBy!.autocompleteScore!
|
||||||
lineScore = lineScore * 5 + charValue
|
lineScore = lineScore * 5 + charValue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user