Use LinkedList.peekLast() to avoid walking the whole list
This commit is contained in:
parent
b0001697f5
commit
b9d62c2835
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user