Use LinkedList.peekLast() to avoid walking the whole list
This commit is contained in:
@@ -58,7 +58,7 @@ class Day18(@Lines val input: Input<List<String>>) {
|
||||
operands[i + 1] = result
|
||||
}
|
||||
|
||||
return operands.last()
|
||||
return operands.peekLast()
|
||||
} else {
|
||||
|
||||
var i = 0
|
||||
|
||||
Reference in New Issue
Block a user