$ 0 0 +1, scrolled way too far to find this. This is optimal in both runtime and memory usage. This should be the answer